Skip to content

Dynamically add MinimumOSVersion to App.framework Info.plist based on the deployment target the binary is compiled with #176313

@jmagman

Description

@jmagman

We have (probably incorrect) deployment instructions that tell the developer to update ios/Flutter/AppframeworkInfo.plist to match the iOS app deployment version (see #175334 for an example of the confusion). However that plist should match the App binary -miphoneos-version-min, not the app-level deployment target.

// When the minimum version is updated, remember to update
// template MinimumOSVersion.
// https://github.com/flutter/flutter/pull/62902
'-miphoneos-version-min=${FlutterDarwinPlatform.ios.deploymentTarget()}',

if (environmentType == EnvironmentType.physical)
'-miphoneos-version-min=${FlutterDarwinPlatform.ios.deploymentTarget()}'
else
'-miphonesimulator-version-min=${FlutterDarwinPlatform.ios.deploymentTarget()}',

Instead of checking MinimumOSVersion into the project via the create template, we could instead remove that key from the template, have a migration to remove it from AppframeworkInfo.plist, and instead when the plist is copied to the App.framework, dynamically add the MinimumOSVersion with plutil and the correct value.

flutterProject.ios.appFrameworkInfoPlist.copySync(
environment.outputDir.childDirectory('App.framework').childFile('Info.plist').path,
);

Once it's in stable, remove the deployment instructions with a note that "after Flutter 3.x this section is no longer needed"

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions