Post

Replies

Boosts

Views

Activity

Fails to Find AuthKey .p8 in Unity Cloud Build Post-Build Script
Hi everyone!I got an error trying to automatically upload my .ipa to TestFlight through Post-build script (Unity Cloud Build (Build Automation)): [error] ErrorDomain=ITunesConnectionAuthenticationErrorDomain Code=-26000 “Failed to generate JWT token: ErrorDomain=NSCocoaErrorDomain Code=-43 ‘Failed to load AuthKey file.’ The file ‘AuthKey_<YOUR_API_KEY>.p8’ could not be found in: • /BUILD_PATH/.../private_keys • ~/private_keys • ~/.private_keys • ~/.appstoreconnect/private_keys” In post-build.bash I tried the following two options but both don't work: 1 option: KEY_WITH_NEWLINES=$(echo $CONNECT_API_KEY | jq '.private_key |= sub(" (?!PRIVATE|KEY)"; "\n"; "g")' -c -j) echo $KEY_WITH_NEWLINES > ~/.appstoreconnect/private_keys/AuthKey_${API_KEY_ID}.p8 2 option: mkdir -p ~/.appstoreconnect/private_keys echo "$CONNECT_API_KEY" | jq -r '.private_key' > ~/.appstoreconnect/private_keys/AuthKey_${API_KEY_ID}.p8 In Unity Cloud Build (Build Automation) → Advanced Options → Environment Variables → Variable value for CONNECT_API_KEY I indicate in the following format: {"private_key":"-----BEGIN PRIVATE KEY-----\nMIIEv...\n-----END PRIVATE KEY-----"} Please tell me how to fix the error? Is it wrong in my code in post-build.bash or the input format Variable value for CONNECT_API_KEY?
2
0
123
Jun ’25