You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 115c53d
Browse filesBrowse the repository at this point in the historyBrowse files
[stable] [flutter_tools] Handle missing Xcode gracefully in getInfo and buildMacOS (#191902)
This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request)
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.
### Issue Link:
#191176
### Impact Description:
When running `flutter build macos` or `flutter build ios` on systems where Xcode is uninstalled, incomplete (e.g. Command Line Tools only), or misconfigured, `XcodeProjectInterpreter.getInfo` invokes `xcrun xcodebuild -list` which exits with code 72 (`unable to find utility "xcodebuild"`). Because code 72 was not in the allowed exit codes, `flutter_tools` crashes with an unhandled `ProcessException`. In Flutter 3.47.1 telemetry, this was a top crash with 320 crashes (15.2% share of top 10 crashes). This impacts development workflows on macOS.
**Conflict Resolution Note**: Resolved a minor merge conflict in `packages/flutter_tools/lib/src/macos/build_macos.dart` by ordering the Xcode installation pre-flight check ahead of workspace validation.
### Changelog Description:
[flutter/191176] When building for macOS or iOS on machines with missing or incomplete Xcode installations, flutter_tools displays an actionable error message instead of crashing with an unhandled ProcessException.
### Workaround:
Install Xcode or configure the active developer directory via:
`sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer`
### Risk:
### Test Coverage:
### Validation Steps:
1. On a macOS machine, switch `xcode-select` to Command Line Tools: `sudo xcode-select -s /Library/Developer/CommandLineTools`.
2. Run `flutter build macos` in a Flutter project.
3. Verify `flutter_tools` displays a clean `ToolExit` instructing the user to install or configure Xcode, rather than crashing with an unhandled `ProcessException` and stack trace.
4. Run automated test suite: `dart test test/general.shard/ios/xcodeproj_test.dart` and `dart test test/commands.shard/hermetic/build_macos_test.dart`.
0 commit comments