Skip to content

[flutter_tools] Unhandled ProcessException when xcodebuild is missing or exits with code 72 during build macos #191176

Closed

Description

@bkonyi

Summary

In Flutter 3.47.0 telemetry, an unhandled ProcessException when invoking xcodebuild emerged as a top crash signature.

When running flutter build macos on a machine where Xcode is not installed, incomplete (e.g. Command Line Tools only), or misconfigured, flutter_tools crashes with an unhandled ProcessException instead of providing a graceful ToolExit error message.

Telemetry Profile

  • Release: Flutter 3.47.0 (Top 10 crasher)
  • Signature: ProcessException at RunResult.throwException at package:flutter_tools/src/base/process.dart-bd2448f2

Error Output

ProcessException: Process exited abnormally with exit code 72:
xcrun: error: unable to find utility "xcodebuild", not a developer tool or in PATH
  Command: /usr/bin/arch -arm64e xcrun xcodebuild -clonedSourcePackagesDirPath ... -skipPackageUpdates -skipPackagePluginValidation -skipPackageSignatureValidation -list -project Runner.xcodeproj

Stack Trace

#0      RunResult.throwException (package:flutter_tools/src/base/process.dart:153:5)
#1      _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart:379:19)
<asynchronous suspension>
#2      XcodeProjectInterpreter.getInfo (package:flutter_tools/src/ios/xcodeproj.dart:423:25)
<asynchronous suspension>
#3      buildMacOS (package:flutter_tools/src/macos/build_macos.dart:149:40)
<asynchronous suspension>
#4      BuildMacosCommand.runCommand (package:flutter_tools/src/commands/build_macos.dart:61:5)

Root Cause

  1. buildMacOS in packages/flutter_tools/lib/src/macos/build_macos.dart lacked pre-flight toolchain validation (globals.xcodeProjectInterpreter?.isInstalled != true) before querying Xcode project information.
  2. In XcodeProjectInterpreter.getInfo (packages/flutter_tools/lib/src/ios/xcodeproj.dart), xcodebuild -list is executed with throwOnError: true while only allowing exit codes 66 and 74. When xcrun returns exit code 72 (unable to find utility "xcodebuild"), _processUtils.run throws an uncaught ProcessException.
  3. buildMacOS improperly used non-null assertions on projectInfo! when resolving build schemes.

Proposed Fix

  • Add pre-flight Xcode toolchain check in buildMacOS to exit early with globals.userMessages.xcodeMissing.
  • Wrap XcodeProjectInterpreter.getInfo in a try ... on ProcessException block to convert unexpected process failures to user-friendly ToolExit messages.
  • Add safe null checks on projectInfo in buildMacOS.

Activity

  1. added
    c: crashStack traces logged to the console
    toolAffects the "flutter" command-line tool. See also t: labels.
    platform-macosBuilding on or for macOS specifically
    team-toolOwned by Flutter Tool team
    P1High-priority issues at the top of the work list
    triaged-toolTriaged by Flutter Tool team
    on Aug 16, 2026
  2. self-assigned this
    on Aug 16, 2026
  3. github-actions commented on Sep 7, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  4. locked as resolved and limited conversation to collaborators on Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: crashStack traces logged to the consolefound in release: 3.47Found to occur in 3.47platform-macosBuilding on or for macOS specificallyteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions