java.io.IOException: DerInputStream.getLength(): lengthTag=107, too big
big-shadow opened this issue · 1 comments
big-shadow commented
Yet another Failed to load signer "signer #1"
but this one has a different inner exception (I looked at the other issues)
My private key file's base64 string seems to be too long? Interested in your take here.
Failed to load signer "signer #1"
java.io.IOException: DerInputStream.getLength(): lengthTag=107, too big.
at java.base/sun.security.util.DerInputStream.getLength(DerInputStream.java:602)
at java.base/sun.security.util.DerValue.init(DerValue.java:383)
at java.base/sun.security.util.DerValue.<init>(DerValue.java:324)
at java.base/sun.security.util.DerValue.<init>(DerValue.java:337)
at java.base/sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:1973)
at java.base/sun.security.util.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:222)
at java.base/java.security.KeyStore.load(KeyStore.java:1479)
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.getSignerConfig(ApkSignerTool.java:368)
at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:291)
at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:84)
Error: The process '/usr/local/lib/android/sdk/build-tools/30.0.2/apksigner' failed with exit code 2
dercilima commented
It's happen with me as well! The problem was in my signingKeyBase64 stored in Github Secrets.
Follow the next steps:
openssl base64 < some_signing_key.jks | tr -d '\n' | tee some_signing_key.jks.base64.txt
- Open the file
some_signing_key.jks.base64.txt
- Copy all content
- Go to the Github Secrets and add or update your Action Secret for signingKeyBase64
- Save and try again
It worked for me!