-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
Problem
When using SwiftPM, the Flutter tool generates a Package.swift file that adds plugins to the app's builds. This Package.swift's supported platforms should match the Xcode project's Minimum Deployments.
However, if in Xcode I update my Minimum Deployments and then do a build, the Package.swift file isn't updated to the latest supported platforms. See: #162072
Repro
-
Create an app with a plugin:
flutter create my_app cd my_app flutter pub add url_launcher -
Generate the project configuration with SwiftPM on:
flutter config --enable-swift-package-manager flutter build ios --config-only -
Open the project in Xcode:
open ios/Runner.xcworkspace -
In Xcode, open Project Navigator > Package Dependencies > FlutterGeneratedPluginSwiftPackage.
Check the generated package's supported platforms:
let package = Package( name: "FlutterGeneratedPluginSwiftPackage", platforms: [ .iOS("12.0") ], ... )
-
In Xcode, open Runner target > General > Minimum Deployments and set iOS to
15.0 -
In Xcode, build the app
-
Check the generated package's supported platforms. It will still be
.iOS("12.0")❌
Workaround
To fix this, build the app using the Flutter tool:
flutter build ios --config-only
This regenerates the Package.swift file and updates its supported platforms.