Android Build Keystore Not Valid

I have not used Solar2D for a while.
Wanted to publish an app.

Problem 1)
I updated my JDK but not Solar2d, and was able to sign and build the android files fully signed.
On uploading to Google Play store, I was told that my .aab file “currently targets API level 29 and must target at least API level 31 to ensure it is built on the latest APIs optimized for security and performance. Change your app’s target API level to at least 31”

I had no idea what this meant, as I had only published apps for a hobbie in the past.

So I updated Solar2d and also JDK again.

Problem 2)
On doing an updated to Solar2D, my build process then keeps reporting that I do not have a valid keystore.
On some other forum posts here in solar2d. One person suggestions building to a new folder/path and this solved the problem - but didn’t work for me.

So before I get back to solving Problem 1, I’m now stuck trying to solve Problem 2, to generate a new build, to upload, and hope that this is API Level 31 compatible and also fixes Problem 1.

In order to solve Problem 2) I found another forum that suggests I build from within Github.
Now I’m down a blackhole learning about how to configure github and google cloud console.
I’ve no clue what I am doing.

Can any one help.

Android target API levels are changed with new Solar2D builds. Solar2D has targeted level 32 since v2022.3672, so a simple update fixes that.

Solar2D hasn’t required a JDK for a long while. It comes bundled in with Solar2D these days, so you should just be able to build.

I’m not sure what the issue with the keystore is, but I’ve never heard of anyone needing to build from within GitHub (or how something like that would even be done). Is this your private keystore for release builds? Does the androiddebugkey keystore still work?

You can try if uninstalling the JDK helps. If that doesn’t, I’ve understood some have been able to fix the issue by simply moving the keystore to a new folder (which would suggest there may be some registry related issue?).

Hiya,

Thanks for this insight… the last app I did was over a year or more ago. So really handy to know the JDK is no longer an extra need. Thanks for the heads up.

Before I updated Solar2D. I was able to build using the keystore.

When uploading to Google Play i got the message about it being API 29.

Thats what made me think an update was needed, but since doing so, it wont sign the build off.
Its most frustrating.

I’m generating my keystore and key no problem.

Can you build with the debug key that comes with Solar2D, or are you unable to build with either the debug key or your own?

Could you copy your console log here so that we could better see what might be going on?

make sure you have latest solar2D and JDK 15 for your key
JDK is required to create the keystore but not for building an apk

I’m running: 2022.3683 now.
I’ve moved the keystore to differnt folders. no luck.
I’ve checked the path to Keystore and it shows the correct path. To the best of my knowledge.

Yes - just done a successful debug build.

I just uninstalled and re installed JDK 15 - no luck still.

If the debug keystore works, then it sounds to me like the issue is not with Solar2D, but with your keystore.

Just to double check, did you do as kakula said and use JDK 15 to build your keystore? i.e. don’t just reinstall JDK 15, but install it, rebuild your keystore with it and then try loading the new keystore in Solar2D.

Again, your Solar2D console likely has more details on what is going wrong. Here’s what a successful loading of a keystore should look like:

15:23:44.107  Testing credentials for 'C:\someFolder\myFolder\myKey.keystore': 
15:23:45.408  jar signed.
15:23:45.408  Picked up JAVA_TOOL_OPTIONS: -Duser.language=en
....

If it’s an issue with your keystore being incorrectly created, then this might help:

My console, is not reporting anything at all

Im on a PC, but that is exactly the message I am getting. See screenshots.


JAVA_HOME Path
JAVA_HOME


KeytoolNotValid

I’ve deleted JDK 15 and now tried the process with 19. I can delete the store and JDK and try again - but I feel like im just going round in loops and my console is not reporting anything. The moment I hit the build button, instantly it errors. Nothing runs.

So I followed the suggestions made in this post, see screenshot V2 above.
And still it failed.

Other then copying and pasting these commands, I do not know what to do as I do not understand what all of the instructions in the commends mean.

So having read this article, I get we are creating the key, storing it in the keystore, then converting the type from JKS to PKCS12 but other then this - I’m truely lost as to what the problem is or how to solve

you are using jdk 19

it should be 15
and the name of your package is too short and weird

it’s better be something.something.something at least

Ok, I will repeat the entire process with 15.
But I don’t follow what you mean by the name.
Can you write what you mean as an example?

I think there’s been some confusion. I thought this issue was related to Solar2D, but seems that it is just about creating the keystore.

Regrettably I’ve never had issues with this, so I haven’t spent time debugging it myself and therefore don’t know of some obvious things that might be going wrong.

I’d recommend Googling for your error message:
java.io.filenotfoundexception keystore.jks (the system cannot find the file specified)
java.io.filenotfoundexception (the system cannot find the file specified)

Some StackOverflow answers suggest it could be that your directory isn’t accessible. You could try moving the keystore to another drive and trying it again over there if there’s some inherent security feature preventing you from doing it on C: drive.

For what it’s worth, I try to avoid doing anything in the command line with a directory structure that has spaces in it. Probably just a holdover from being a Windows user in the bad old days, but you might give it a try.