-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Force plugins to inherit minimum iOS version from Flutter app #66590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@domesticmouse This should resolve #66103. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be wrong (hard to tell in GitHub), but it looks to me like lines 285-288 are indented 1 col too far, while 289-290 look ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. Good eye (again).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we leave a breadcrumb comment at the location in the tool where we define the min version to also update this magic constant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is the best place to put it. Since it's a test to check that interdependencies in plugins work correctly rather than checking the project->plugin connection. Should this just be in plugin_tests.dart?
Also how do we know plugins A/B/C/D says iOS 8? Tangentially, do we need to update
flutter/packages/flutter_tools/templates/plugin/ios-swift.tmpl/projectName.podspec.tmpl
Line 18 in 6b04937
| s.platform = :ios, '8.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this just be in plugin_tests.dart?
I moved it there, see if you like it better.
Also how do we know plugins A/B/C/D says iOS 8?
I changed the test to make the plugin version low (7.0) so it would trigger the warning on the devicelab machines running Xcode 11.
Tangentially, do we need to update
as well?flutter/packages/flutter_tools/templates/plugin/ios-swift.tmpl/projectName.podspec.tmpl
Line 18 in 6b04937
s.platform = :ios, '8.0'
If we updated to s.platform = :ios, '9.0' then newly created plugins would not be usable (complication error) in any projects created before #60035, and we have no migration (yet) to increase this value in already existing apps.
01f59b6 to
445a01c
Compare
|
LGTM! |
Background
Xcode supports specific SDK ranges, and every release they drop the lowest. For example, Xcode 11 dropped support for iOS 7, and Xcode 12 dropped support for iOS 8.
Xcode emits a warning when build targets support a minimum version lower than the range to indicate it can't validate compilation against the older SDK.
This warning is benign: if the app supports a minimum of iOS 9.0, it doesn't cause any problems that a plugin framework embedded in the app supports iOS 7.0. These warnings concern users who think there's something wrong with their app, and there's no way for users to fix it (the plugin author would have to up their minimum supported version).
Flutter's plugin template defaults to a minimum of iOS 8, so when Xcode 12 dropped that version, every plugin started emitting this warning, so this problem became much more visible.
Description
If the plugin's minimum version is less than iOS 9, remove the version build setting. This will cause it to inherit from the minimum version set in the Flutter app (currently 9.0).
If the plugin minimum is higher than iOS 9, leave the build setting so if there is a versioning range issue (the plugin supports a minimum iOS 12 but the app needs iOS 9) the correct error (not warning) will be emitted.
Related Issues
Fixes #40109
Fixes #63253
See also
CocoaPods/CocoaPods#7314
#36117
Tests
Updated plugin_dependencies_test to make sure this warning isn't emitted. Confirmed it fails on master.
Checklist
///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change