Google Play Upload Issue: You uploaded an APK signed with a certificate that expires too soon.

I am having problems publishing my first game to Google Play.  I get the following message when I try to upload my APK to ALPHA upload on Google Play account.

Upload failed

You uploaded an APK signed with a certificate that expires too soon. You need to sign your APK with a certificate that expires farther into the future.

 

Below is what I did to sign my APK file before uploading it to Google Play.  I used the Keytool built in Java 7 and the command line to do this.   I have already setup the Keytool path on my windows system. 

 

If anyone sees any mistakes below, please let me know. 

1.  Using the command line (CMD) type in the following command:

keytool -genkey -v -keystore U-Boat-Bunker-St-Amiot.keystore -alias aliasname -keyalg RSA -validity 999999

 

Where mykeystore is my application name (U-boat Bunker St Amiot) not sure about the spaces. 

 

Once the key was created it created a file called: “U-Boat-Bunker-St-Amiot.keystore”   Located on my local MyDocuments hard drive.

 

2.  I ran the Corona Simulator and selected “Build for Android” and in “Keystore” browse and select the file just created. Enter the password when prompted.  Then select a new “aliasname” - a name that makes sense.  It ended up making the aliasname - aliasname?? 

 

3.  I uploaded the newley created APK file out of Corona SDK to the Google Play store.

 

OK I TRIED THE ABOVE AND GOT THE FOLLOWING ERROR IN GOOGLE 

 

_ Upload failed _

_ You uploaded an APK signed with a certificate that expires too soon. You need to sign your APK with a certificate that expires farther into the future. _

 

Based on what I did above, any ideas.  I am really stuck on this one???    Thanks, Jan

If you typed the command exactly as you typed it above, your alias name is “aliasname”.

keytool -genkey -v -keystore U-Boat-Bunker-St-Amiot.keystore -alias aliasname -keyalg RSA -validity 999999

Now you did set the validity to 999999 which should be way into the future.  Perhaps you could google around to find the keystore commands that will dump information about the keystore and see when it’s really set to expire.

Rob

Thanks Rob!    Lots to learn and absorb being a newie to all of Keystore Certificate stuff :slight_smile:

I am going to try creating the certificate using eclipse, rather than the command line, on another windows non-corona computer.   I was getting an error trying to open the certificate using Keystore commands.   So I am thinking the file was corrupt and will try making it with eclipse on my other computer (the other computer does not have Corona SDK on it).  Keystore never did let me reopen the certificate eventhough I had the correct password.   

I found out Keystore certificates can be moved between machines - which is a good thing.  I think even between an windows computer and my Apple laptop??    

To confirm, has anyone else created a single Keystore certificate and used it for all their builds on iOS AND Android?     This would save me from creating a certificate on my apple/corona computer.

Thanks, Jan

OK - Finally Got My Game App on Google Play.   Here is what I did for the sake of those feeling your way thru the darkness like I was:

1.  HOW TO CREATE KEYSTORES:  Create a Key Certificate using either the CMD (Command Line) or using Android Eclipse SDK Keystore Plug in.  The command line (cmd) version should already be on any computer that uses Java 6  and above.  You may need to create a system path to the file Keystore.exe in your Java bin directory. 

An easier way to create Keystore keys is using the Android Eclipse Keystore plugin.  There is an excellent youtube video that shows you how to setup the plugin in Eclipse:  (on youtube search for Eclipse Keystore plugin - by Mark Fleming)  The Eclipse keystore plug in permits you to open the keystore and view the contents if you want to.   For your game app in Corona, it does not matter what name you use for your keystore name.  The imporant thing to remember is the password and alias you use.   The corona build IDE will ask you for this information when you use your new Keystore key.

2.  There are DEBUG and PRODUCTION Keystore keys.  Google will not allow you to release into production a game app that has a debug keystore associated with it.  Debug keys allow you to ‘side load’ your app on to your android device.  If you upload your game app to Google Play with production keys, and you have certificate security code in your game, you will not be able to side your app anymore.  (I found this out the hard way)    Instead you will have to set up beta testers and have beta testers download the beta game via Google Play.   I have a debug version of my game which has the identical code as the production-gold version.    This way I can side load and test the game without setting up Google groups, beta testers, etc…

By default the Corona Build IDE Keystore is set to: ‘C:\Program Files\Corona Labs\Corona SDK\Resources\debug.keystore’  this is the debug Keystore.  By default the Corona Build IDE has the ‘Key Alias’ set to ‘androiddebugkey’.  When you create your production Keystore key, you will need to enter whatever you used as your alias name. 

3.  Keystore keys are transferable between computers.  You must keep your keystore password and alias forever as long as you want to update the game on Google play.  If you lose your password - your pretty much in big ‘do do’.   I am hoping to use the same Keystore on my apple when I get to that point.

4.  GOOGLE PLAY VERSIONS.  Google permits you to upload and copy over your previous version.  I want to ultimately release with version 1.  I was worried I could not upload and over write my previous version without going to a new version (1 to 2).  In the Corona Build IDE you can keep the version at 1 and just change the ‘Code Name’ to 1.1. or whatever.  This way you can always keep your game app at version 1 for the release.  In the Google Play Developer Console the game app will show up as 1(1.2).

Sorry for the book guys!!  Hopefully this info will help others feeling your way thru the darkness - looking for answers, as I was…  I am sure there is something I missed, if there is, please let me know.

If you typed the command exactly as you typed it above, your alias name is “aliasname”.

keytool -genkey -v -keystore U-Boat-Bunker-St-Amiot.keystore -alias aliasname -keyalg RSA -validity 999999

Now you did set the validity to 999999 which should be way into the future.  Perhaps you could google around to find the keystore commands that will dump information about the keystore and see when it’s really set to expire.

Rob

Thanks Rob!    Lots to learn and absorb being a newie to all of Keystore Certificate stuff :slight_smile:

I am going to try creating the certificate using eclipse, rather than the command line, on another windows non-corona computer.   I was getting an error trying to open the certificate using Keystore commands.   So I am thinking the file was corrupt and will try making it with eclipse on my other computer (the other computer does not have Corona SDK on it).  Keystore never did let me reopen the certificate eventhough I had the correct password.   

I found out Keystore certificates can be moved between machines - which is a good thing.  I think even between an windows computer and my Apple laptop??    

To confirm, has anyone else created a single Keystore certificate and used it for all their builds on iOS AND Android?     This would save me from creating a certificate on my apple/corona computer.

Thanks, Jan

OK - Finally Got My Game App on Google Play.   Here is what I did for the sake of those feeling your way thru the darkness like I was:

1.  HOW TO CREATE KEYSTORES:  Create a Key Certificate using either the CMD (Command Line) or using Android Eclipse SDK Keystore Plug in.  The command line (cmd) version should already be on any computer that uses Java 6  and above.  You may need to create a system path to the file Keystore.exe in your Java bin directory. 

An easier way to create Keystore keys is using the Android Eclipse Keystore plugin.  There is an excellent youtube video that shows you how to setup the plugin in Eclipse:  (on youtube search for Eclipse Keystore plugin - by Mark Fleming)  The Eclipse keystore plug in permits you to open the keystore and view the contents if you want to.   For your game app in Corona, it does not matter what name you use for your keystore name.  The imporant thing to remember is the password and alias you use.   The corona build IDE will ask you for this information when you use your new Keystore key.

2.  There are DEBUG and PRODUCTION Keystore keys.  Google will not allow you to release into production a game app that has a debug keystore associated with it.  Debug keys allow you to ‘side load’ your app on to your android device.  If you upload your game app to Google Play with production keys, and you have certificate security code in your game, you will not be able to side your app anymore.  (I found this out the hard way)    Instead you will have to set up beta testers and have beta testers download the beta game via Google Play.   I have a debug version of my game which has the identical code as the production-gold version.    This way I can side load and test the game without setting up Google groups, beta testers, etc…

By default the Corona Build IDE Keystore is set to: ‘C:\Program Files\Corona Labs\Corona SDK\Resources\debug.keystore’  this is the debug Keystore.  By default the Corona Build IDE has the ‘Key Alias’ set to ‘androiddebugkey’.  When you create your production Keystore key, you will need to enter whatever you used as your alias name. 

3.  Keystore keys are transferable between computers.  You must keep your keystore password and alias forever as long as you want to update the game on Google play.  If you lose your password - your pretty much in big ‘do do’.   I am hoping to use the same Keystore on my apple when I get to that point.

4.  GOOGLE PLAY VERSIONS.  Google permits you to upload and copy over your previous version.  I want to ultimately release with version 1.  I was worried I could not upload and over write my previous version without going to a new version (1 to 2).  In the Corona Build IDE you can keep the version at 1 and just change the ‘Code Name’ to 1.1. or whatever.  This way you can always keep your game app at version 1 for the release.  In the Google Play Developer Console the game app will show up as 1(1.2).

Sorry for the book guys!!  Hopefully this info will help others feeling your way thru the darkness - looking for answers, as I was…  I am sure there is something I missed, if there is, please let me know.