ilharp / sign-android-release

A GitHub action to sign an APK or AAB
https://github.com/marketplace/actions/sign-android-release-2
MIT License
43 stars 10 forks source link

getting error signing apk #7

Closed saintmalik closed 1 year ago

saintmalik commented 1 year ago
Signing APK file.
  /usr/local/lib/android/sdk/build-tools/33.0.0/apksigner sign --ks *** --ks-key-alias *** --ks-pass pass:*** --out android/app/build/outputs/apk/release/app-release-signed.apk --key-pass pass:*** android/app/build/outputs/apk/release/app-release-temp.apk
  Failed to load signer "signer #1": *** entry "***" does not contain a key

Error: Error: The process '/usr/local/lib/android/sdk/build-tools/33.0.0/apksigner' failed with exit code 2
Error: Error: The process '/usr/local/lib/android/sdk/build-tools/33.0.0/apksigner' failed with exit code 2

i ran openssl base64 < my-upload-key.keystore | tr -d '\n' |tee my-upload-key.keystore.base64.txt and save the base64 encoded key to my github action secrets

What could i have done wrong? Screenshot 2022-09-22 at 2 06 39 PM

ilharp commented 1 year ago

There might be some issues with your keystore.

Use base64 -d my-upload-key.keystore.base64.txt > decoded-key.keystore to verify that it is exactly the same as the original, and keytool -list -v -keystore decoded-key.keystore to verify that it is a valid keystore.

saintmalik commented 1 year ago

Thanks for your quick response, i figured it out, it was the Alias name that was wrong

Alias name: my-key-alias

Also if i am using this method to sign my app, does it means i must not implement the signing via app/build.gradle again, correct?

ilharp commented 1 year ago

Looks like there're some invalid action secrets causing this error. Try recreating all secrets, taking care not to type extra spaces and returns.

You can also take a look at this issue of the upstream repo.

If the above doesn't work, you may need to create a public minimal repro - follow your steps to create a new repo with a blank Android project and this action, then post your repo link here and I'll help you.

ilharp commented 1 year ago

Oh you've figured it out yourself - 👍

Yes, you must not sign your apk in project Gradle script.

saintmalik commented 1 year ago

thank you