1

I tried to generate the keystore however, Seems like it's not working. I'm not used to create the apk and release via terminal. So if I may be doing something wrong, it would be great if you can tell me some hints or samples.

My location of the project

/Users/myself/Desktop/CocoFolder/MyGame

Tried the following code. But not sure what to enter.

keytool -genkey -v -keystore /Users/myself/Desktop/CocoFolder/MyGame
 -alias MyGame -validity 10000

Planning to use this to create a release apk.

cocos run -s/Users/myself/Desktop/CocoFolder/MyGame -p android –android-studio -m release
Abhishek Aryan
  • 19,936
  • 8
  • 46
  • 65
Jennifer
  • 1,822
  • 2
  • 20
  • 45

1 Answers1

2

Two questions :

  1. How I generate keystore that required to sign your apk

    How can I create a keystore?

  2. Done you've now your keystore with specified alias name, Now you want to generate signed apk from your keystore.

    Put this into~/.gradle/gradle.properties

    RELEASE_STORE_FILE={path to your keystore}
    RELEASE_STORE_PASSWORD=*****
    RELEASE_KEY_ALIAS=*****
    RELEASE_KEY_PASSWORD=*****
    

    After that, Build --> Select Build Variant --> Set release for your game and build.

Community
  • 1
  • 1
Abhishek Aryan
  • 19,936
  • 8
  • 46
  • 65
  • Thank you, one last thing. I get the following error when I uploaded the apk to the store. What does this mean? I've set the validity to 10000. "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" – Jennifer May 21 '17 at 15:05
  • 1
    Set expiration to be greater than 50 years. `-validity 20000` – Abhishek Aryan May 21 '17 at 15:09