Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Error when building Android build with release key
Started by sergio.rodrigo.royo Mar 21 2019 05:41 AM

6 replies to this topic

Best Answer Rob Miracle , 25 March 2019 - 01:07 PM

Unfortunately the keytool command is horribly documented.  Oracle defaults -validity to 90 days. Google wants at least 25 years which is 9125 days. Your choice of 10000 gets you those 25 years plus some. There may be a limit of 5 digits for the validity parameter as 99999 is 273 years. There isn't much reason to go to 999,999 or 2700 years. This could have been causing you the error.

Depending on the version of keytool you have, the keysize may be too small and Android Studio may be defaulting to something lot helpful. 2048 bits is a good value for the keysize!

 

Rob

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

sergio.rodrigo.royo

[GLOBAL: userInfoPane.html]
sergio.rodrigo.royo
  • Observer

  • 13 posts
  • Corona SDK

Hi,

I've created my own key to sign my game:

 

C:\Program Files\Android\Android Studio\jre\bin\keytool.exe" -genkey -v -keystore myapp.keystore -alias myapp -keyalg RSA -validity 999999

I introduced all the information as explained here https://coronalabs.com/blog/2014/08/26/tutorial-understanding-android-app-signing/

 

Tried to create an Android build with this key (asked for passwords and all of that, so looked cool), and got this:

14:24:49.432  Testing credentials for 'C:\Users\sergi\myapp.keystore': 
14:24:50.583  Picked up JAVA_TOOL_OPTIONS: -Duser.language=en
14:24:50.583  jar signed.
14:24:51.665  Excluding specified files from build: 
14:24:51.665     excluding: LaunchScreen.storyboardc
14:24:51.665     excluding: Icon.png
14:24:51.665     excluding: Icon-*dpi.png
14:24:51.665     excluding: Images.xcassets
14:25:56.410  BuildID: 5c9390a53f99c
14:25:56.704  WebServices: downloading build
14:26:02.077  Android build failed (1) after 71 seconds

I've tried with different keys and applications, and I'm getting the same problem.

I'm using the latest stable version of Corona (2018.3326)



[TOPIC: post.html]
#2

sergio.rodrigo.royo

[GLOBAL: userInfoPane.html]
sergio.rodrigo.royo
  • Observer

  • 13 posts
  • Corona SDK

Just tried with 2019.3470 too, and same problem.



[TOPIC: post.html]
#3

sergio.rodrigo.royo

[GLOBAL: userInfoPane.html]
sergio.rodrigo.royo
  • Observer

  • 13 posts
  • Corona SDK

Still same problem today.

I don't know Unity much, but just tried to create a hello world there and sign the apk with the same key/keystore, and upload it to the Google Play console (which didn't allow me to upload unless the apk was signed with a non-debug keystore), and it was fine. So it doesn't look like a problem with the keystore(s) I tried.

I love how convenient is having a build server, but the way Corona creates builds is a bit opaque and there isn't much control of what's going on. I don't even get a message about the error cause.



[TOPIC: post.html]
#4

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Enthusiast

  • 91 posts
  • Corona SDK

Hello!

 

A few days ago I uploaded 4 new apps for a client.

No problem.

 

Also I update live apps frequently without errors and problems.

 

Corona is not at it's best lately but maybe you should check your methods again.

 

Sorry I can't help more.


  • sergio.rodrigo.royo likes this

[TOPIC: post.html]
#5

sergio.rodrigo.royo

[GLOBAL: userInfoPane.html]
sergio.rodrigo.royo
  • Observer

  • 13 posts
  • Corona SDK

Okay, so it looks like it works after regenerating the keystore from the command-line instead of from Android Studio. Third try really, this time adding -keysize 2048 and a lower validity value (10000, previous was 999999). Not sure about why this works when signing with Unity, and even less sure about why the first keystore I tried, generated from Android Studio, doesn't work with Corona.



[TOPIC: post.html]
#6

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,779 posts
  • Enterprise

  Best Answer

Unfortunately the keytool command is horribly documented.  Oracle defaults -validity to 90 days. Google wants at least 25 years which is 9125 days. Your choice of 10000 gets you those 25 years plus some. There may be a limit of 5 digits for the validity parameter as 99999 is 273 years. There isn't much reason to go to 999,999 or 2700 years. This could have been causing you the error.

Depending on the version of keytool you have, the keysize may be too small and Android Studio may be defaulting to something lot helpful. 2048 bits is a good value for the keysize!

 

Rob


  • sergio.rodrigo.royo likes this

[TOPIC: post.html]
#7

sergio.rodrigo.royo

[GLOBAL: userInfoPane.html]
sergio.rodrigo.royo
  • Observer

  • 13 posts
  • Corona SDK

Thanks Rob, that clarifies a lot.




[topic_controls]
[/topic_controls]