Verifying APP_STORE_CONNECT_PRIVATE_KEY content... 0 #3148
-
If you are looking for help, please confirm the following...
Which mobile framework are you using?iOS (Swift, Objective-C) Steps to reproduceDear Codemagic Support Team, I am experiencing a persistent issue when trying to publish my iOS application to App Store Connect (TestFlight) using Codemagic. It appears that the The Error I am receiving is:
(Note: The error message above refers to the original variable name. I have since corrected the variable name in my configuration, but the underlying issue persists.) Diagnosis and Troubleshooting Steps Taken: To diagnose the root cause, I added a debugging script to my The output of This indicates that, within the script execution environment, the Actions I have already taken to try and resolve the problem (in chronological order):
Despite all these steps and thorough checks, the Could you please investigate why this "Secure text" variable appears to be empty in the build environment? It seems to be an issue with how Codemagic is loading or providing this specific variable to the workflow. Thank you for your attention to this matter. I look forward to your prompt response and possible solutions. Sincerely, Edilson Santos Expected resultsI want successfully uploaded to Apple, processed, and made available for testing on TestFlight**, without any private key or publishing errors. Actual resultsapp-store-connect publish: error: argument --private-key: Provided value in environment variable "APP_STORE_CONNECT_PUBLISHER_PRIVATE_KEY" is not valid. Provided value is not a valid PEM encoded private key Failed to publish App.ipa to App Store Connect. Build failed :| Publishing failed :| Build id (optional)685462c7ff047b06b21a1701 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Hello @EdilsonBaggio, |
Beta Was this translation helpful? Give feedback.
-
I am defining it this way environment:
|
Beta Was this translation helpful? Give feedback.
-
I made the adjustment according to your comment, calling the groups. But another problem returned. == Gathering artifacts == == Publishing artifacts == Publishing artifact App.ipa
Publish "/Users/builder/clone/build/IPA/App.ipa" to App Store Connect Upload "/Users/builder/clone/build/IPA/App.ipa" to App Store Connect Failed to upload archive at "/Users/builder/clone/build/IPA/App.ipa" Failed to publish App.ipa to App Store Connect. Build failed :| Publishing failed :| It looks like it's at the end of the yaml app_store_connect: This part makes the publication in testFlight do I need to define the "groups" in it too? |
Beta Was this translation helpful? Give feedback.
-
I did it, thanks! |
Beta Was this translation helpful? Give feedback.
Hello @EdilsonBaggio,
Can you please confirm that you are defining the group in which the environment variable is stored in your
codemagic.yaml
file?For instance if I add environment variables to a group named "secrets" as shown below,
Then I also need to define it in my YAML as below:
You can also find more details about setting this up in this section of the docs - https://docs.codemagic.io/yaml-publishing/app-store-connect/#setting-up-publishing-to-app-store-connect