-
Notifications
You must be signed in to change notification settings - Fork 6k
Set MinimumOSVersion in iOS Info.plist based on buildroot setting #28743
Conversation
@@ -264,7 +267,6 @@ | |||
isa = PBXResourcesBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
0D6AB73F22BD8F0200EEE540 /* FlutterEngineConfig.xcconfig in Resources */, |
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.
Not related to this change, but xcconfigs should not be embedded as resources in the app.
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 catch.
#28783 is a more targeted fix. I will rebase on it when it lands so the App Store submission issue isn't regressed in case this needs to be reverted for some reason. |
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 don't think the test should be hardcoded for iOS 9.0. But otherwise mostly just nits.
@@ -264,7 +267,6 @@ | |||
isa = PBXResourcesBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
0D6AB73F22BD8F0200EEE540 /* FlutterEngineConfig.xcconfig in Resources */, |
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 catch.
- (void)testInfoPlist { | ||
// Check the embedded Flutter.framework Info.plist, not the linked dylib. | ||
NSURL* flutterFrameworkURL = | ||
[NSBundle.mainBundle.privateFrameworksURL URLByAppendingPathComponent:@"Flutter.framework"]; |
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.
Instead of attempting to resolve the bundle by path, [NSBundle bundleForClass:[FlutterEngine class]]
might be less brittle. For instance, I am not sure why this is in the private frameworks URL (presumably because its in the test bundle but not sure).
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 tried -[NSBundle bundleForClass:]
first, unfortunately it doesn't work, the bundle is nil. Before this PR, the test does not link against/embed/load the Flutter.framework with the Info.plist. Instead, it embeds libios_test_flutter, which has the compiled Flutter and test code.
engine/shell/platform/darwin/ios/BUILD.gn
Line 232 in 0292339
"-Wl,-install_name,@rpath/Frameworks/libios_test_flutter.dylib", |
F7521D7826BB68BC005F15C5 /* libios_test_flutter.dylib in Embed Libraries */, |
$ nm -g out/ios_debug_sim_unopt/libios_test_flutter.dylib | grep FlutterEngine
0000000003987fd8 S _OBJC_CLASS_$_FlutterEngine
0000000003988078 S _OBJC_CLASS_$_FlutterEngineGroup
0000000003987880 S _OBJC_CLASS_$_FlutterEngineGroupTest
0000000003987ba0 S _OBJC_CLASS_$_FlutterEnginePartialMock
00000000039878d0 S _OBJC_CLASS_$_FlutterEngineTest
0000000003988028 S _OBJC_METACLASS_$_FlutterEngine
00000000039880a0 S _OBJC_METACLASS_$_FlutterEngineGroup
0000000003987858 S _OBJC_METACLASS_$_FlutterEngineGroupTest
0000000003987b78 S _OBJC_METACLASS_$_FlutterEnginePartialMock
00000000039878a8 S _OBJC_METACLASS_$_FlutterEngineTest
But I want to test the Info.plist in the final bundle, so I embedded it in the app in this PR so I could leverage the NSBundle
API. I'm open to suggestions for a better way to test this.
NSBundle* flutterBundle = [NSBundle bundleWithURL:flutterFrameworkURL]; | ||
|
||
NSDictionary<NSString*, id>* infoDictionary = flutterBundle.infoDictionary; | ||
XCTAssertEqualObjects(infoDictionary[@"MinimumOSVersion"], @"9.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.
__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
maybe? Or, is the test harness not compiled with the same minimum OS version requirement? The next time we bump this up, we will need to update test too when all this test is doing is checking that what we specify in the GN rule ends up as verbatim in the Info.plist.
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.
Or, is the test harness not compiled with the same minimum OS version requirement?
It's not, the test lib is built with ios_testing_deployment_target
engine/shell/platform/darwin/ios/BUILD.gn
Line 228 in 0292339
"-mios-simulator-version-min=$ios_testing_deployment_target", |
And the test app is built with 12.2
IPHONEOS_DEPLOYMENT_TARGET = 12.2; |
The next time we bump this up, we will need to update test too when all this test is doing is checking that what we specify in the GN rule ends up as verbatim in the Info.plist.
Well, it's also testing that the copy_info_plist.py
script works. I can just test that it's a well-formatted version string, if you prefer. Otherwise, you're right, the buildroot SHA update that includes the config change will also need to update this test in the same commit.
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 can just test that it's a well-formatted version string, if you prefer.
Don't have too strong of an opinion on this but I'd definitely prefer components and tests not making assumptions about the version floor. Just checking for a well formatted string should be fine.
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 replaced the check with a regex.
* a1400b4 Roll Dart SDK from 6e17953f4e7e to ba343ec30c69 (1 revision) (flutter/engine#28807) * 22fe15a Set MinimumOSVersion in iOS Info.plist based on buildroot setting (flutter/engine#28743) * b872267 Roll Fuchsia Linux SDK from bWZcp2jnx... to tBL8VjITE... (flutter/engine#28804)
Ignoring the web framework test since the failure originates from a repo synchronization issue between engine and framework. The new failing tests were sync'ed in from head in the test and the tested code doesn't exist in the engine at the time of branch cut. * Fixes FlutterSemanticsScrollView to not implement accessibility container API (#28846) * add branch to test * Replace jcenter() for mavenCentral() (#28777) * Set MinimumOSVersion to iOS 9 in Info.plist (#28783) * Do not use jcenter(), switch to mavenCentral() (#28738) Co-authored-by: chunhtai <[email protected]> Co-authored-by: Emmanuel Garcia <[email protected]> Co-authored-by: Jenn Magder <[email protected]> Co-authored-by: Dan Field <[email protected]>
* a1400b4 Roll Dart SDK from 6e17953f4e7e to ba343ec30c69 (1 revision) (flutter/engine#28807) * 22fe15a Set MinimumOSVersion in iOS Info.plist based on buildroot setting (flutter/engine#28743) * b872267 Roll Fuchsia Linux SDK from bWZcp2jnx... to tBL8VjITE... (flutter/engine#28804)
The Flutter.framework minimum version was bumped to 9.0 as of #28572 / flutter/buildroot#509. However, the framework's Info.plist was not updated, which causes App Store "Invalid bundle" submission failures.
argparse
in copy_info_plist.py to make it easier to add new arguments to the script--minversion
to the script, to be used as theMinimumOSVersion
value in the iOS Info.plist to keep the value in sync with the buildroot setting.Follow up to #28783, would have also fixed flutter/flutter#90209
Pre-launch Checklist
writing and running engine tests.
///
).