-1

I am trying to setup a complete CI / CD workflow with Codemagic on my GitLab repository for my Flutter project in order to distribute and publish the iOS and Android apps on Firebase App Distribution.

So far I successfully manage to have it work for Android, however it won't work for iOS although the job completes successfully on Codemagic.

Looking at the generated artifacts:

Generated artifacts upon successful build

To my suprise, I noticed that Codemagic generated a zip file containing an .app file. To my understanding, such is the file extension for MacOS Applications, not iOS applications which is .ipa.

I don't even have the right plan to build MacOS Apps:

targeted platforms

Before posting here, I looked at tutorials and various somewhat outdated guides because all of them showed an option, in the build settings for a checkbox titled "Flutter build ipa" that does not exist on my CI / CD.

I don't understand where I got things wrong.


Here a few screenshots of the workflow setup:

Build setup:

Build setup

Firebase Distribution setup

Thanks in advance for the help. enter image description here

Mackovich
  • 3,319
  • 6
  • 35
  • 73
  • You probably just need to change the .zip filename so it has a .ipa extension – Clive Apr 02 '23 at 01:31
  • @Clive, already tried it and this is the error I am getting when manually upoloading to Firebase App Distribution: `There's been an error parsing your app's info.plist. Ensure you are uploading a valid IPA and try again.`. Also, having to have to rename it manually defeat the purpose of autonomous distribution, doesn't it? – Mackovich Apr 02 '23 at 08:43
  • Well, yes. I just remember, at one point at least, that manual steps to building an .ipa involved exporting a .app, putting it in a folder, zipping the folder, then changing the extension – Clive Apr 02 '23 at 08:56

1 Answers1

1

Have you setup your iOS build with the required configuration for code signing? as having the Runner.app.zip as build artifact is the normal result of having setup your iOS build to be a debug build and debug builds are only for running on an iOS Simulator.

For example if I setup a Codemagic project to do debug builds for iOS, ie. in the builds log you see for the build step:

== Building for iOS ==

> flutter build ios --debug --no-codesign

... [REDACTED] ...

Running Xcode build...                                          
Xcode build done.                                           35.8s
Built /Users/builder/clone/build/ios/iphoneos/Runner.app.

then as you can see in the log, the expected artifact produced on successful build is Runner.app.zip

Maks
  • 7,562
  • 6
  • 43
  • 65
  • Thank you for your answer. I did not know I was supposed to sign the iOS app. Does that require an active pro account at Apple (with the yearly fee)? – Mackovich Apr 02 '23 at 11:58
  • @Mackovich yes, you need an Apple Developer account in order to have a signing certificate from Apple, to sign your ipa file. This Codelab covers the topic in more detail, note that it specifically says that you need a paid Apple developer account: https://firebase.google.com/codelabs/appdistribution-udid-collection#0 – Maks Apr 03 '23 at 01:02