'Does not pick the right AppIcon when distributing Flutter app to App Store
I have created multiple environments(Development, QA, Production) in my flutter app using flavors and it works fine. To differentiate each environments, I have created different AppIcons for each. When I run in iOS simulator it install with right AppIcon, but after distributing the App Store using 'Codemagic' it picks wrong icon 'AppIcon'(Default), it should be 'ProductionAppIcon'.
In Codemagic.yamal file:
environment:
vars:
XCODE_WORKSPACE: "$FCI_BUILD_DIR/ios/Runner.xcworkspace"
XCODE_SCHEME: "Runner"
- app-store-connect fetch-signing-files "$BUNDLE_ID" --type IOS_APP_STORE --create
- keychain add-certificates
- xcode-project use-profiles
- flutter build ipa -t lib/src/main_prod.dart — flavor Production --release
- name: Build ipa for distribution
script: xcode-project build-ipa --workspace "$XCODE_WORKSPACE" --scheme "$XCODE_SCHEME"
artifacts:
- build/ios/ipa/*.ipa
- $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.dSYM
- /tmp/xcodebuild_logs/*.log
- '*.snap'
- build/windows/**/*.msix
- flutter_drive.log
Project folder structure is as follows:
Xcode configurations as follows:
Schemas are as follows:
Solution 1:[1]
You don't need to use xcode-project build-ipa command because it re-builds ipa without flavor information.
Check this project out to see working demo of building Flutter flavors.
And there is also extra whitespace before flavor in your command
flutter build ipa -t lib/src/main_prod.dart — flavor Production --release
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mikhail Tokarev |



