Reputation: 21
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Failed to read key key from store "/Users/klien/klien/document/key.jks": Invalid keystore format
Upvotes: 2
Views: 1505
Reputation: 497
It seems that it's really important to generate the keystore with a very particular version of the keytool
executable. On my Windows machine, a search for keytool.exe
yielded lots of results:
c:\Program Files\Android\Android Studio\jre\bin\keytool.exe
c:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot\bin\keytool.exe
c:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot\jre\bin\keytool.exe
c:\Program Files (x86)\Java\jre1.8.0_301\bin\keytool.exe
c:\ProgramData\Sony Mobile\Update Engine\{5152617D-088D-4700-97C9-A2696A37E999}\jre\bin\keytool.exe
c:\Users\All Users\Sony Mobile\Update Engine\{5152617D-088D-4700-97C9-A2696A37E999}\jre\bin\keytool.exe
For my React Native application, I initially created the keystore with c:\Program Files (x86)\Java\jre1.8.0_301\bin\keytool.exe
assuming that this would the be most authorative Java installation, and got the "Invalid keystore format"
error.
The solution was to go with c:\Program Files\Android\Android Studio\jre\bin\keytool.exe
. The rationale behind this would be to use the same Java installation as the build engine (in my case - gradlew bundleRelease
).
(Copy pasted my answer from here: How to solve invalid keystore format in android studio?)
Upvotes: 1