Skip to content

Remove the iOS build configuration naming requirements when using flavors #182368

Description

@alex-medinsh

Use case

In an iOS app with no flavors, there are three default build configurations in the Xcode project: Debug, Profile and Release. When one wants to add flavors to an iOS app, they need to create a scheme for each of the flavors, but also new build configurations that follow a convention like: Buildmode-Flavor (Debug-apple, Release-banana etc). This means that for each flavor three new build configurations are created.

The Flutter tool then validates if the Xcode project has the required build configuration and passes it to the xcodebuild command. If the corresponding build configuration does not exist, the build fails, even though there is enough information in the scheme itself to not require to pass the configuration manually.

We have an app that has multiple flavors that each have a separate iOS target. The schemes allow us to select which target and which build configurations to use, so Xcode can select the correct build configuration depending on the flavor provided in the run/build command. We do not need multiple build configurations, since we are using targets to customise the flavors (icon, name, bundle id etc), but the Flutter tool forces us to have the configurations for each combination of build mode and flavor. This quickly builds up and pollutes the Xcode project.

Proposal

Allow the build even if Xcode project does not contain a build configuration corresponding to current build mode and flavor. The scheme is always selected that corresponds to the flavor and already contains the required information to select the correct build configuration.

I would be happy to contribute the changes myself, but I am not yet sure if I have not missed some cases where this might break things.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: proposalA detailed proposal for a change to Flutterplatform-iosiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project managementteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions