Monday 8 March 2021

Cannot sign an APK with Android Studio - Getting exception: DerInputStream.getlength()

I just inherited an old project, which created back in 2013.

The Keystore is probably created with jdk 7.

When I try to generate the APK in Android studio, an exception is thrown:
Cannot load key store: Unable to initialize, java.io.IOException: DerInputStream.getLength(): Redundant length bytes found

enter image description here

What I tried is:

  • Convert the Keystore to pk12 - Here I'm getting the same exception as above
  • Open the keystore in KeyStore Explorer - Not working either, I'm unable to view the key
  • I also tried to contact google (play store support), but they respond with "our team isn’t trained to provide technical support for key."

Related posts:
Android keystore corrupted
Unable to open keystore in AndroidStudio - "Redundant length bytes found"

I have no idea what to do next.

The only thing that works is by manually sign an unsigned apk in terminal.
This solution is not optimal. Furthermore, it only works when using an old jdk version (jdk1.7.0_80 in this case) So I cannot use this solution for a long term.



from Cannot sign an APK with Android Studio - Getting exception: DerInputStream.getlength()

No comments:

Post a Comment