Flutter release APK:Invalid keystore format with Linux(deepin)
I had this issue as well. I'm using android studio.
I unnecessarily installed a java JDK and used that to generate a keytool, which is incorrect because you are supposed to use the one provided from Android Studio.
Steps:
flutter doctor -v
Should see a
Java binary at:
under Android toolchain, this is the dir where your keytool is location, mine was/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
Replace
java
withkeytool
so in this case/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/keytool
Run it directly, in my case I ran
/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home/bin/keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
Follow prompt
The key.jks file will appear in your main dir. Normally somewhere in
/Users/<username>/key.jks
Now build your android app with this keytool should solve your problem

Sheng Gao
Updated on November 18, 2022Comments
-
Sheng Gao about 1 month
I try release APK with Flutter,but went wrong:
Execution failed for task ':app:packageRelease'.
Failed to read key key from store "/home/jerome/key.jks": Invalid keystore format
-
Hossein Abedi 11 monthsSame for React Native. I used: $JAVA_HOME/jre/bin/keytool