From eadea0ca9955d612e122c265be310611d4220d8b Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Fri, 27 Mar 2026 14:56:27 +0800 Subject: [PATCH] fix(macos): guard Flutter Assemble phase against direct xcodeproj launch Prevents build failure when opening Runner.xcodeproj directly instead of Runner.xcworkspace by checking WORKSPACE_DIR at build time and reporting actionable error message. --- macos/Runner.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index b64a3b42..574eaa5a 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -390,7 +390,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + shellScript = "if [[ \"${WORKSPACE_DIR:-}\" == *.xcodeproj ]]; then\n echo \"error: XWorkmate macOS builds with CocoaPods plugins must be launched from macos/Runner.xcworkspace, not Runner.xcodeproj.\" >&2\n echo \"error: Open macos/Runner.xcworkspace in Xcode or run 'flutter build macos' from the repository root.\" >&2\n exit 1\nfi\n\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; 8E8C2A3EBAA3461603096C04 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase;