I have been struggling with this Github Action using Fastlane and match for iOS deployment to TestFlight of a flutter app.
Everything started to break when I changed laptop and forgot the keychain password. I nuked all previous certificates and profiles (using match) and regenerated them.
Everything seems to be going fine in match, however the build fails with a 65 error code and no clear error
This is the lane code
platform :ios do
lane :closed_beta do
setup_ci(verbose: true)
match(
type: 'appstore',
app_identifier: "#{BUNDLE_IDENTIFIER}",
git_basic_authorization: Base64.strict_encode64(ENV["GIT_AUTH_TOKEN"]),
readonly: true,
verbose: true,
)
build_app(
scheme: "Runner",
export_method: "app-store",
verbose: true,
)
pilot(
apple_id: "#{APPLICATON_ID}",
app_identifier: "#{BUNDLE_IDENTIFIER}",
skip_waiting_for_build_processing: true,
skip_submission: true,
distribute_external: false,
notify_external_testers: false,
ipa: "./Runner.ipa",
itc_provider: "CN7XB83K76"
)
end
end
Relevant logs are
INFO [2023-02-15 14:22:09.12]: ▸ ** ARCHIVE FAILED **
Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
** ARCHIVE FAILED **
ERROR [2023-02-15 14:22:09.14]: Exit status: 65
INFO [2023-02-15 14:22:09.15]:
and there is something above logged as error by match (but I don't think it's a problem)
INFO [2023-02-15 14:21:44.80]: ▸ "/Users/runner/Library/Keychains/fastlane_tmp_keychain-db"
DEBUG [2023-02-15 14:21:44.80]: Installing WWDR Cert: curl -f -o /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/AppleWWDRCAG6.cer20230215-42299-x0khh8 https://www.apple.com/certificateauthority/AppleWWDRCAG6.cer && security import /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/AppleWWDRCAG6.cer20230215-42299-x0khh8 -k /Users/runner/Library/Keychains/fastlane_tmp_keychain-db
INFO [2023-02-15 14:21:45.15]: ▸ 1 certificate imported.
INFO [2023-02-15 14:21:45.15]: ▸ 100 794 100 794 0 0 2688 0 --:--:-- --:--:-- --:--:-- 2719
ERROR [2023-02-15 14:21:45.22]: There are no local code signing identities found.
You can run `security find-identity -v -p codesigning fastlane_tmp_keychain` to get this output.
This Stack Overflow thread has more information: https://stackoverflow.com/q/35390072/774.
(Check in Keychain Access for an expired WWDR certificate: https://stackoverflow.com/a/35409835/774 has more info.)
INFO [2023-02-15 14:21:45.30]: $ security import /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/d20230215-42299-tdvo05/certs/distribution/PY2SL32M49.cer -k '/Users/runner/Library/Keychains/fastlane_tmp_keychain-db' -P ******** -T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild -T /usr/bin/productsign
INFO [2023-02-15 14:21:45.39]: ▸ 1 certificate imported.
INFO [2023-02-15 14:21:45.40]: Setting key partition list... (this can take a minute if there are a lot of keys installed)
INFO [2023-02-15 14:21:45.40]: $ security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k ******** /Users/runner/Library/Keychains/fastlane_tmp_keychain-db 1> /dev/null
ERROR [2023-02-15 14:21:45.44]: security: SecItemCopyMatching: The specified item could not be found in the keychain.
INFO [2023-02-15 14:21:45.44]: $ security import /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/d20230215-42299-tdvo05/certs/distribution/PY2SL32M49.p12 -k '/Users/runner/Library/Keychains/fastlane_tmp_keychain-db' -P ******** -T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild -T /usr/bin/productsign
INFO [2023-02-15 14:21:45.54]: ▸ 1 key imported.
A full log of the failing run is here