Flutter xcode project ignores DART_DEFINES in CI pipeline

86 views Asked by At

This happens in the following scenario:

I have two jobs (build and deploy) running in GitLab CI. In the build job I run flutter build ios --release --no-codesign --dart-define=PROFILE="prod" and in the deploy job I build the actual IPA for deployment via (fastlane run gym scheme:"Runner" workspace:"Runner.xcworkspace" export_method:"app-store"). The deploy job is based on and uses the entire ios sub project folder resulted from the build job.

Please note, since I have to set a specific provisioning profile in the pipeline which currently isn't possible via the flutter tool I must use tools like fastlane-update_code_signing_settings & fastlane-gym instead of flutter build ipa ...

Unfortunately the built ipa doesn't respect DART_DEFINES which gets set in the build job even though I can confirm that flutter_export_environment.sh and Generated.xcconfig exist and do contain DART_DEFINES properly in the deploy job.

But when I also run flutter build ios --release --no-codesign --dart-define=PROFILE="prod" in the same deploy job (prior to the fastlane run gym command) then the built ipa does respect DART_DEFINES and the app works like a charm.

Thus, what am I missing here? I want to avoid having to run flutter build ios in the deploy job and keep the jobs separated. Do I have to run a specific script manually (which is eventually run by flutter build ios under the hood)?

0

There are 0 answers