r0adkll / sign-android-release

A GitHub action to sign an APK or AAB
MIT License
351 stars 130 forks source link

Failed to load signer "signer #1" #34

Open StarHeartHunt opened 3 years ago

StarHeartHunt commented 3 years ago

StackTrace:

Verification succesful
/bin/cp app/build/outputs/apk/release/app-release-unsigned.apk app/build/outputs/apk/release/app-release-unsigned-aligned.apk
/usr/local/lib/android/sdk/build-tools/29.0.3/apksigner sign --ks app/build/outputs/apk/release/signingKey.jks --ks-key-alias *** --ks-pass pass: --out app/build/outputs/apk/release/app-release-unsigned-signed.apk app/build/outputs/apk/release/app-release-unsigned-aligned.apk
Failed to load signer "signer #1"
java.io.EOFException
    at java.io.DataInputStream.readInt(DataInputStream.java:392)
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:661)
    at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:57)
    at sun.security.provider.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:224)
    at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(JavaKeyStore.java:71)
    at java.security.KeyStore.load(KeyStore.java:1445)
    at com.android.apksigner.SignerParams.loadKeyStoreFromFile(SignerParams.java:353)
    at com.android.apksigner.SignerParams.loadPrivateKeyAndCertsFromKeyStore(SignerParams.java:239)
    at com.android.apksigner.SignerParams.loadPrivateKeyAndCerts(SignerParams.java:181)
    at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:277)
    at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:83)
Error: The process '/usr/local/lib/android/sdk/build-tools/29.0.3/apksigner' failed with exit code 2
me-at-syeds-me commented 3 years ago

I am having similar issue. No luck so far!

soethan98 commented 3 years ago

I'm also facing this issue.

ankitmhatre commented 3 years ago

@me-at-syeds-me @soethan98 Any luck ?

thaiphandinh commented 3 years ago

any updates on this?

riv0manana commented 3 years ago

Hello, I've tested this action to sign my apk. This issue is caused when wrong "signingKeyBase64" is provided. Solution: run in your terminal: openssl base64 -in your_keystore.keystore -out key.txt and then copy the output content to your signingKeyBase64 secret. Hope it can help you

taori commented 2 years ago

hm. ordinary base64 turns my keystore into 3kb file, openssl base64 turns it into 4kb. perhaps that is why some people have this error and others do not? (i have it at the moment. verifying whether it works with openssl base64) nope. still does not sign properly

atanana commented 2 years ago

I had the same error message when I misspelled "SIGNING_KEY" in my secrets 🤦‍♂

marwa-eltayeb commented 2 years ago

I have the same error. What is the solution?

nathantaal commented 2 years ago

For me it was me creating the wrong gitlab variables

faizandarwesh commented 2 years ago

Any update on this issue?

vitalyk-multinarity commented 2 years ago

Hello, I've tested this action to sign my apk. This issue is caused when wrong "signingKeyBase64" is provided. Solution: run in your terminal: openssl base64 -in your_keystore.keystore -out key.txt and then copy the output content to your signingKeyBase64 secret. Hope it can help you

@riv0manana did you use key.txt as is or deleted newlines from it?

vengateshm commented 2 years ago

Using the below command worked for me, it printed the key in console and i copied that. openssl base64 -in your_keystore.keystore

Devanathan2015 commented 1 year ago

Using the below command worked for me, it printed the key in console and i copied that. openssl base64 -in your_keystore.keystore

I tried the same. But still the issue persist for me. I encode the key-store file in mac, but i am using windows-2019 as runner.

Failed to load signer "signer #1"
  java.io.IOException: Invalid keystore format
  at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:666)
  at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:57)
  at sun.security.provider.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:224)
  at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(JavaKeyStore.java:71)
  at java.security.KeyStore.load(KeyStore.java:1445)
  at com.android.apksigner.SignerParams.loadKeyStoreFromFile(SignerParams.java:353)
  at com.android.apksigner.SignerParams.loadPrivateKeyAndCertsFromKeyStore(SignerParams.java:239)
  at com.android.apksigner.SignerParams.loadPrivateKeyAndCerts(SignerParams.java:181)
  at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:277)
  at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:83)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2293,2): error MSB6006: "java.exe" exited with code 2. 
taori commented 1 year ago

CR/LF issue?

ItSNeverLate commented 4 months ago

Your password, alias, or keyword is incorrect! Just double-check!