-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Open
Open
Task
Copy link
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectplatform-iosiOS applications specificallyiOS applications specificallyplatform-macBuilding on or for macOS specificallyBuilding on or for macOS specificallyteam-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
Background
SwiftPM strictly enforces that your iOS target version is equal to or higher than your dependencies' iOS target version.
If your app target has a minimum deployment of iOS 12 but a SwiftPM plugin requires iOS 15, you'll get an error like: #162196 (comment)
Failed to build iOS app
Could not build the precompiled application for the device.
Target Integrity (Xcode): The package product 'cloud-firestore' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
Target Integrity (Xcode): The package product 'firebase-core' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
The solution to this problem is documented here: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-app-developers#how-to-use-a-swift-package-manager-flutter-plugin-that-requires-a-higher-os-version
Suggestion
The Flutter CLI should catch this error and provide a more helpful error message. For example:
$ flutter run
Failed to build iOS app
Target Integrity (Xcode): The package product 'cloud-firestore' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
To fix this, raise your app's minimum platform version or remove this dependency.
To increase your app's minimum platform version:
1. Open your app (ios/Runner.xcworkspace or macos/Runner.xcworkspace) in Xcode.
2. In the Project Navigator, select the Runner project > Runner target > General tab
3. Increase your app's target Minimum Deployments setting.
4. If you updated your iOS app's Minimum Deployments, regenerate the iOS project's configuration files:
flutter build ios --config-only
5. If you updated your macOS app's Minimum Deployments, regenerate the macOS project's configuration files:
flutter build macos --config-only
Part of #126005
Pedro-e, YumNumm, haizadvnet, rcjuancarlosuwu and KoheiKanagu
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectplatform-iosiOS applications specificallyiOS applications specificallyplatform-macBuilding on or for macOS specificallyBuilding on or for macOS specificallyteam-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