2

I create an empty flutter project using Flutter 3.0.0 (also tried 2.10.5).

I can build it, run it on my iPhone and archive the app from the command line.

When running the same commands through Github Actions Im unable to archive my app.

The same machine is hooked up to Github Actions as a self-hosted runner.

Im using XCode 13.4, but also tried XCode 13.0.

The command I run locally and through Github Actions is: flutter build ipa --target=lib/main.dart --release --obfuscate --split-debug-info --build-number=${{github.run_number}} -v

When running it on Github Actions with verbose turned on this is the output: https://paste.ee/p/ernDZ

If you search for "Failed", the second hit gives this and it might be a hint:

Target release_unpack_ios failed: Exception: Failed to codesign /Users/john/Library/Developer/Xcode/DerivedData/Runner-bfrqxpkjfhgyupczrlqcnaiaydrh/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/Flutter.framework/Flutter with identity XXXXXXX
uniquenamehere
  • 1,869
  • 3
  • 31
  • 60
  • Might the obfuscation be a problem: https://docs.flutter.dev/deployment/obfuscate#caveat ? – David May 24 '22 at 12:43
  • @David The same issue appears when the obfuscation option is removed. What you link to is if your code use introspection and that that will not work when using obfuscation as class, function and library names are stripped. – uniquenamehere May 24 '22 at 22:32
  • I meant the paragraph below the headline "Caveat", but anyway it was only a guess that it could perhaps change something. It's clear the the error is related to dart but I don't know how dominant dart is in flutter, so maybe that is not helping very much. – David May 25 '22 at 06:33
  • Any luck setting up flutter ci/cd pipeline? – Dishank Jindal Aug 20 '22 at 13:08

1 Answers1

2

I found the reason. It is because when executing the build command using Github runner, the keychain is not unlocked. So you need to unlock the keychain (using a step in Github Actions) first:

security unlock-keychain -p <YourPassword>

See:

Minh Danh
  • 263
  • 2
  • 10