Search code examples
androidkeytool

Android KeytoolException: Failed to read key AndroidDebugKey lengthTag=109, too big


I've been trying to generate an .apk (debug or release) and I've been getting this error:

com.android.ide.common.signing.KeytoolException: Failed to read key AndroidDebugKey from store "/home/note-300/.android/debug.keystore": DerInputStream.getLength(): lengthTag=109, too big.

I already tried creating a new key (with key and alias with the same name) on Android Studio, I deleted the .android/debug.keystore and run the following commands (from here):

keytool -importkeystore -srckeystore old.keystore -destkeystore new.keystore -deststoretype pkcs12

and

 keytool -importkeystore -srckeystore new.keystore -srcstoretype pkcs12 -destkeystore final.keystore -deststoretype jks

What else can I do to run my app?

OS: Ubuntu 18.04

Android Studio 3.3.1


Solution

  • Try upgrading gradle from in the gradle-wrapper.properites file from 4.10.1 to 4.10.2. I had the same problem, and that fixed it for me.