Invalid keystore

This is a common problem, but the previous discussions aren’t helping.

Environment:
Mac
Solar2d Build: 2022.3677
Java 1.8.0_242-release

Google insisted I create a new keystore, which I did using:

keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore ig2.keystore

Trying to build the app with that keystore, however, results in:

The password for the Keystore located at /Users/davidmarques/prog/ks/ig2.keystore is not correct or the file is not a valid Keystore

The app builds fine with any of my other keystores, and the password I am entering is decidedly correct, I have entered it many times very carefully.

That leaves the Java out of sync. But previous messages on this topic say to upgrade, but I think I am already current, and changing Java breaks many other things on mac and, I think, make my other keystores not work.

Is there any other way around this? Convert the keystore somehow? Or point Solar2d at a different version of Java? Which version?

I had this problem the other day and just made a quick keystore in Android Studio

Problem is, I already made the keystore and registered it with Google, and they only allow a keystore change once per lifetime of the app. So creating a new keystore a different way is not an option (unless I beg?).

I assume it has to do with the pkcs12 vs jsk format. My new key is pkcs12 format, and I am guessing the build requires a jsk format. I am looking to try to convert.

Fixed, that was it, converting format PKCS12 to the old format JKS.

I found instructions here

But the instructions are badly written, you only need the last step, step 8:

keytool -v -importkeystore -srckeystore eneCert.pkcs12 -srcstoretype PKCS12 -destkeystore keystore.ks -deststoretype JKS

2 Likes