Skip to content

"flutter run" failing for iOS target due to Git version mismatch #184376

Description

@jason-simmons

I'm currently seeing this error from flutter run when running on my MacBook and targeting an iOS simulator:

Uncategorized (Xcode): Exited with status code 255

Could not build the application for the simulator.
Error launching application on iPhone 16e.

flutter run -v verbose logs include these errors:

fatal: multi-pack-index version 2 not recognized
...
Failed to download https://storage.googleapis.com/flutter_infra_release/flutter/e69de29bb2d1d6434b8b29ae775ad8c2e48c5391/engine_stamp.json. Ensure you have network connectivity and then try again.

I recently upgraded to macOS 26.4 - this may be related to that.

Investigated this and found that:

  • This happens because the bin/cache/engine.stamp file is overwritten during the execution of flutter run
  • During flutter run the bin/internal/update_engine_version.sh script is run with a modified PATH that is presumably set by Xcode
  • That path places /Applications/Xcode.app/Contents/Developer/usr/bin at the start of PATH
  • That directory contains a version of git that identifies itself as git version 2.50.1 (Apple Git-155)
  • Running that version of git on my checkout of Flutter produces the fatal: multi-pack-index version 2 not recognized error. My setup usually has Git 2.53 at the head of its PATH, and Git 2.50.1 is not compatible with the repository created by 2.53.
  • The bin/internal/content_aware_hash.sh script does not catch the error, computes the wrong hash, and writes that to bin/cache/engine.stamp
  • The e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 hash seen in the bad URL comes from git hash-object --stdin computing a hash for the empty output of the failing git ls-tree command in content_aware_hash.sh

Issues:

  • content_aware_hash.sh should produce an error if this occurs
  • flutter run for Apple platforms needs a way to work around Xcode's manipulation of the PATH to prefer Apple's version of Git

@jtmcdole @jmagman

Pinned by vashworth

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyplatform-macosBuilding on or for macOS specificallyteam-infraOwned by Infrastructure teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-infraTriaged by Infrastructure teamworkaround availableThere is a workaround available to overcome the issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions