-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Closed
Copy link
Labels
e2-daysEffort: < 5 daysEffort: < 5 daysfrom.page-issueReported in a reader-filed concernReported in a reader-filed concernp2-mediumNecessary but not urgent concern. Resolve when possible.Necessary but not urgent concern. Resolve when possible.
Description
Page URL
https://docs.flutter.dev/deployment/flavors
Page source
No response
Describe the problem
The flavors documentation does not include a step to set the FLUTTER_APP_FLAVOR Dart define for the appFlavor constant. This is important to include when building from XCode, as otherwise the appFlavor is null.
Expected fix
When setting up Schemes in XCode, we should also add the following to the documentation:
- Navigate to the
Build Settingsof the target(s) - If
DART_DEFINESdoes not exist yet
2a) Click the+button in the top left
2b) ClickAdd User-Defined Setting
2c) For the name enterDART_DEFINES
2d) For the value take the base64 encoded version ofFLUTTER_APP_FLAVOR=<value>, where<value>is the name of the flavor that is expected to be theappFlavorin Dart - If
DART_DEFINESdoes exist, the values are delimited by a comma (this should be verified, I am not sure) But it is important to encode the entire string as base64 - If
DART_DEFINESis already defined inGenerated.xcconfig, delete theGenerated.xcconfigand enter the Dart defines in XCode, before trying again.
Additional context
I confirmed that this is not a tool bug, as the Flutter tool already picks up existing DART_DEFINES from the iOS/MacOS Scheme when present.
I would like to fix this problem.
- I will try and fix this problem on docs.flutter.dev.
Metadata
Metadata
Assignees
Labels
e2-daysEffort: < 5 daysEffort: < 5 daysfrom.page-issueReported in a reader-filed concernReported in a reader-filed concernp2-mediumNecessary but not urgent concern. Resolve when possible.Necessary but not urgent concern. Resolve when possible.
