Cannot create a PhoneGap Signing Key with JDK version 12.0.0

I successfully created a signing key with JDK version 11 and sent my .apk file to Google who requested some modifications. I have now, two months later, made these modifications.

But now I find that the only available version of the Java Development Kit is version 12.0.1 (not version 11, which I have uninstalled). I have used version 12.0.1 in three unsuccessful attempts to create a signing key, and I have re-installed it twice.

In each attempt, after I go to the “…Java\bin” sub-directory, input the recommended “getkey” command and insert all of my contact details, I got the same diagnostic error which seems to be about a missing file, as follows:

“keytool error: java.io.FileNotFoundException: PlanPrediction.keystore (Access is denied)
java.io.FileNotFoundException: PlanPrediction.keystore (Access is denied)
at java.base/java.io.FileOutputStream.open0(Native Method)
at java.base/java.io.FileOutputStream.open(FileOutputStream.java:292)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:235)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:124)
at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:1333)
at java.base/sun.security.tools.keytool.Main.run(Main.java:409)
at java.base/sun.security.tools.keytool.Main.main(Main.java:402)”

To me, the problem seems to be either an error with JDK version 12.0.1 or, perhaps, the software is somehow confusing my updated app with the previous version.

Does anyone have any suggestions for overcoming this error?

It sounds like you’re using the PhoneGap CLI method. A lot of stuff like this can be avoided by using PhoneGap Build. Would that work for you?

It looks like either the path isn’t clearly set OR you may have to download JDK 12.0.1 again (I’m still at 11 so I’m interested to see how this works out.)

Are you manually entering the commands or using a .cmd file? I built a .cmd file to generate the keystore files which has greatly reduced the problems I encountered with this process.

keyecho off
IF "%1"=="" (
  echo "You must enter the name of the app/project (i.e. testtube)"
  goto exit
) ELSE (
  keytool -genkey -v -keystore %1.keystore -alias com.%1.android -keyalg RSA -keysize 2048 -validity 999999
pause
)
:exit

I have aways taken the advice of the tech. note and only used PhoneGap Build.

I have never touched PhoneGap CLI.


Virus-free. www.avg.com

Did you add %JAVA_HOME%\bin to your path command?

I am not sure.

I went to “C:\Program Files\Java\jdk-12.0.1\bin” and entered the getkey command.

is that what you mean?


Virus-free. www.avg.com

Oracle made some changes to how the JDK is installed. We’ve updated the tech note to reflect this - give it another try!

https://wiki.appstudio.dev/Submitting_to_the_Google_Play_and_Amazon_Stores

It now works perfectly.

Thank you everyone for your help.

Ray