keytool to bulid release

It works!!! Thankyou so much Rob!!!

So I made a release build and uploaded the apk to google and it says “upload failed, you signed with a certificate that is not yet valid, you need to sign with a certificate that is valid”, can anyone help? I am trying to release it to google

Googling for this error tends to indicate that there is a time setting problem on your computer. There were three different scenarios that leads to this error:

  1. Your time is off, ahead of when it really is.

  2. Your timezone isn’t set correctly.

  3. You’re in a timezone different than Google’s servers and perhaps crossing a day boundary. 

When you created the keystore, one of the values inside it is when it’s validity starts. If you’re keystore is valid in the future due to one the three scenarios above, then Google may not accept the signed app.

There are two main suggestions on how to solve this.

  1. Set your computer’s date and time back a day or two. Remake the keystore. Set your clock back to the current date time and remake your .apk.

  2. Wait a few hours and try again once your current computer date time is old enough to where the keystore has become valid.

Obviously the latter one is the least work but the least satisfying. 

Rob

Thanks again Rob!! :smiley:  :rolleyes:  :slight_smile:

It’s been a while since I built a new version of my app (last time I used corona 2731) but now when trying to build for android using corona 2970, the key alias is blank.  The keystore file shows up fine, when I use keytool to look inside the keystore file it does indicate it has an alias, so??? Can i simply create a new android keystore for the app’s update version or do I have to use the one I have been using previously for this app. and if so, how do i find the key alias, is it another file? Any help much appreciated.

I opened command prompt and type

md Keystores

(enter)

cd %HOMEPATH%

(enter)

C:\Program Files (x86)\Java\jdk1.7.0_80\bin\keytool -genkey -v -keystore android.keystore -alias release -keyalg RSA -validity 999999

(enter)

I get this “C:Program is not recognize as an internal or external command, operable program or batch file”.

My enviromental variables are “Java_Home” with the value “C:\Program Files (x86)\Common Files\Java\Java Update”. What is wrong? I have a windows and I have downloaded the same java package name, the “jdk1.7.0_80”. I have been trying to release for a month and I am very frustrated. Please answer and please be  very specific Rob, I want to release my game 

You probably need quotes around the “C:\Program Files (x86)\Java\jdk1.7.0_80\bin\keytool.exe” 

Rob

It did not result in an error but the command prompt says, “The system cannot find the path specified”. What do you think is wrong?

Unfortunately I can’t see your computer. You indicated above that your JAVA_HOME environment variable is pointing to a folder that has a subdirectory named “java update”. If that’s part of the path, you probably need to include it.

Another option is to go the opposite direction. Use the CD command to change directory to the location that holds keytool.exe and do something more like:

keytool.exe -genkey -v -keystore %HOMEPATH%\android.keystore -alias release -keyalg RSA -validity 999999

or if you want it to end up in your Keystores folder:

keytool.exe -genkey -v -keystore %HOMEPATH%\Keystores\android.keystore -alias release -keyalg RSA -validity 999999

That of course assumes that you were actually in %HOMEPATH% when you did the “md Keystores” command earlier.

Rob

Rob thank you for your time. I am going to ask to help me to start over step by step. I am going to download the Se 7u80 (x86) and redo it again. 

  •     I downloaded java again. I am using wizard, should I download the development tools or the source code?

Go to:  http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

In the 112 block, click on the accept radio button then click on: jdk-8u112-windows-i586.exe

Download and install it.

In your “Search Windows” box type “cmd”. It should give you an option to run the “Command Prompt”.

In the Window that opens type:

cd C:\"Program Files (x86)

cd Java\jdk1.8.0\_112\bin

next type:

md %HOMEPATH%\keystores

This may give you an error if you’ve already created the directory.  Next type in:

keytool.exe -genkey -v -keystore %HOMEPATH%\keystores\android.keystore -alias release -keyalg RSA -validity 999999

It’s should start asking you a bunch of questions that you will have to provide answers that make sense for you. The sequence should go something like:

C:\Program Files (x86)\Java\jdk1.8.0\_112\bin\>keytool.exe -genkey -v -keystore %HOMEPATH%\keystores\android.keystore -alias release -keyalg RSA -validity 999999 Enter keystore password: Re-enter new password: What is your first and last name? &nbsp; [Unknown]:&nbsp; Rob Miracle What is the name of your organizational unit? &nbsp; [Unknown]:&nbsp; Developer Relations What is the name of your organization? &nbsp; [Unknown]:&nbsp; Corona Labs What is the name of your City or Locality? &nbsp; [Unknown]:&nbsp; Austin What is the name of your State or Province? &nbsp; [Unknown]:&nbsp; TX What is the two-letter country code for this unit? &nbsp; [Unknown]:&nbsp; US Is CN=Rob Miracle, OU=Developer Relations, O=Corona Labs, L=Austin, ST=TX, C=US correct? &nbsp; [no]:&nbsp; yes Generating 2,048 bit RSA key pair and self-signed certificate (SHA256withRSA) with a validity of 999,999 days &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for: CN=Rob Miracle, OU=Developer Relations, O=Corona Labs, L=Austin, ST=TX, C=US Enter key password for \<release\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (RETURN if same as keystore password): [Storing \Users\rob\keystores\android.keystore] C:\Program Files (x86)\Java\jdk1.8.0\_112\bin\>

Now this is as “Copy and Paste” as I can make this. Java may or may not install in the directory that it installed for me.

How you bring up the command prompt may be different.

You may choose to have a different password for the .keystore file and for the “release” keystore. In my example I chose to use the same password for both.

Your Keystore file will be in C:\Users\yourname\keystores\android.keystore and you can tell Corona to go to that folder and use the keystore you created.

Rob

Thanks a lot Rob, I can not thank you enough, for your patience. :rolleyes:

It works!!! Thankyou so much Rob!!!

So I made a release build and uploaded the apk to google and it says “upload failed, you signed with a certificate that is not yet valid, you need to sign with a certificate that is valid”, can anyone help? I am trying to release it to google

Googling for this error tends to indicate that there is a time setting problem on your computer. There were three different scenarios that leads to this error:

  1. Your time is off, ahead of when it really is.

  2. Your timezone isn’t set correctly.

  3. You’re in a timezone different than Google’s servers and perhaps crossing a day boundary. 

When you created the keystore, one of the values inside it is when it’s validity starts. If you’re keystore is valid in the future due to one the three scenarios above, then Google may not accept the signed app.

There are two main suggestions on how to solve this.

  1. Set your computer’s date and time back a day or two. Remake the keystore. Set your clock back to the current date time and remake your .apk.

  2. Wait a few hours and try again once your current computer date time is old enough to where the keystore has become valid.

Obviously the latter one is the least work but the least satisfying. 

Rob

Thanks again Rob!! :smiley:  :rolleyes:  :slight_smile: