Repository navigation
Open
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterplatform-iosiOS applications specificallyiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project management"xcodebuild" on iOS and general Xcode project managementteam-iosOwned by iOS platform teamOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Description
Use case
After migrating to Swift Package Manager completely and removing Cocoapods, there is only one project in a typical Flutter app. In that case, the existence of the Runner.xcworkspace becomes meaningless. While Xcode alone can build even if the xcworkspace is deleted, the current Flutter CLI throws an error:
Launching lib/main.dart on iPhone 17 Pro in debug mode...
An error occurred when adding Swift Package Manager integration:
Exception: Xcode workspace not found.
Swift Package Manager is currently an experimental feature, please file a bug at
https://github.com/flutter/flutter/issues/new?template=01_activation.yml
Consider including a copy of the following files in your bug report:
ios/Runner.xcodeproj/project.pbxproj
ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme (or the scheme for the flavor used)
To add Swift Package Manager integration manually, please use the following instructions:
https://docs.flutter.dev/to/add-swift-package-manager-manually
Alternatively, to avoid this failure, disable Flutter Swift Package Manager integration for the project
by adding the following in the project's pubspec.yaml under the "flutter" section:
config:
enable-swift-package-manager: false
Or disable Flutter Swift Package Manager integration globally with the
following command:
"flutter config --no-enable-swift-package-manager"
Error launching application on iPhone 17 Pro.flutter doctor summary
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.41.6, on macOS 26.4.1 25E253 darwin-arm64, locale ja-JP)
[!] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 26.4.1)
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Connected device (4 available)
! Error: Browsing on the local area network for iPhone 13. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
! Doctor found issues in 2 categories.Proposal
Please support projects xcworkspace is missing. If we need to maintain compatibility with CocoaPods, we might also need a process that automatically generates the xcworkspace in cases where a newly added package in pubspec only supports Cocoapods.
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterplatform-iosiOS applications specificallyiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project management"xcodebuild" on iOS and general Xcode project managementteam-iosOwned by iOS platform teamOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Activity
chika3742 commentedon May 2, 2026
Sorry, I closed this by mistake.
[-][SwiftPM] Fall back to xcodeproj when xcworkspace is missing[/-][+][SwiftPM] Support projects without `Runner.xcworkspace`[/+]chika3742 commentedon May 2, 2026
I checked the code, and after making the following three changes, it worked properly in my project.
flutter/packages/flutter_tools/lib/src/migrations/swift_package_manager_integration_migration.dart
Lines 276 to 278 in 23756b2
flutter/packages/flutter_tools/lib/src/migrations/lldb_init_migration.dart
Lines 76 to 79 in 23756b2
flutter/packages/flutter_tools/lib/src/ios/mac.dart
Lines 390 to 400 in 23756b2
Regarding the migration code, I am wondering why the existence of the workspace is being checked. It seems the files in .xcworkspace is not used during the migration process.
[-][SwiftPM] Support projects without `Runner.xcworkspace`[/-][+]Proposal:[SwiftPM] Support projects without `Runner.xcworkspace`[/+]hellohuanlin commentedon May 4, 2026
@chika3742 PRs welcome. Note that there can still be Cocoapods plugins in use, so make sure to check that use case too.
chika3742 commentedon May 6, 2026
I have reconsidered, and I feel that the benefits are outweighed by the significant amount of work required, such as maintaining consistency and updating related documentation. Therefore, I will close this issue myself.
hellohuanlin commentedon May 6, 2026
Well there could be contributors in the community who can help out. Re-opening since it's still a valid issue.
Allow building projects lacking Runner.xcworkspace (flutter#186239)
fix(ios): track Runner.xcworkspace para migración SwiftPM en CI