How do i sign my godot game?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By App_develooer

I have built my game and I want to upload it on Play Store but I have heard that we have to sign the game to upload it on Play Store. Someone please explain the process of signing from start to end. I have heard about creating a keystore file but i do not understand that what do we need to do with the keystore file after creating the keystore file. Please explain the process and not just give the link to the documents of google which explains how to sign your game (all the people i have asked to just do this and not explains). I am trying to sign my godot game from a long time. Someone please explain me about how to sign my godot game.

Oh, it is not only described in the android docs.

There’s also a specific help in the Godot docs for that:
Exporting for Android — Godot Engine (stable) documentation in English

I assume that you created already a debug key and tested your app on an Android device?
Testing and direct apk distribution w/o play store doesn’t require a release

Naturally you’ll also have to fill out the mandatory information in the play store until they’ll accept a (signed) apk. Also you need to meet the requirement (mentioned at the end of the linked doc above) to provide a 64bit version.

if that doesn’t get you further then be more specific about your problem.

wombatstampede | 2020-03-03 17:13

That documentation in godot docs is about exporting to android but not about signing. Can you please explain how to sign and what to do with the keystore file generated for signing. Thanks for your precious time and reply!

App_develooer | 2020-03-07 07:06

:bust_in_silhouette: Reply From: wombatstampede

Ok, there’s some info in the godot doc. I am not sure where your progress actually stops or where the problems begin. It seems you’ve already generated an release/upload key and don’t know how to proceed?

Generally:
You already created a debug key? Then creating the release/upload key is very similar.

Usually you use two keys. I’ll just roughly tell which one is for what.

The debug key is used for local tests and you you can install apks signed with a debug key on (roughly) any android device when it’s configured to allow the install of “untrusted” apps.

“Untrusted” because the debug key (as well as the upload/release key) are both so called “self-signed” certificates. This means that you create the keys just on yourself and there’s no trusted party that acknowledges that these keys/certificates are from your very person.

Then there’s the release key. That is actually very similar to the debug key because you create this key also yourself. But in another keystore.

So in the godot docs is mentioned the basic command line which you use to create the release/upload key:

Uploading an APK to Google’s Play Store requires you to sign using a non-debug keystore file; such file can be generated like this:

keytool -v -genkey -v -keystore mygame.keystore -alias mygame -keyalg RSA -validity 10000

This keystore and key are used to verify your developer identity, remember the password and keep it in a safe place!

This keystore/key is used to sign the app before you upload it to the google play store. Usually, it is just used for upload. Google will sign that app later (automatically) with its own “trusted” key.

So, you created your own release key with the command line mentioned above (replace “mygame” with the title of your own game to be later able to identify what that key is for.)

Then you enter the key data in the “release” key section of the godot android export dialogue. Just as you did previously with the debug key data.

Then export the apk (uncheck the export with debug information).
Until here it is all detailed in the godot docs:

The next step would be to upload the app to google play.
If you let Google handle the signing then google play will learn your upload key the first time when you upload the app to Google Play.

Here’s the section in the google docs about it:

(…)
2. Sign in to your Play Console.
3. Follow the steps to prepare & roll out your release to create a new release.
4. After you choose a release track, configure app signing under the Let Google create and manage my app signing key section as follows:
* To have Google Play generate an app signing key for you and use it to sign your app, select Continue. The key you use to sign your first release becomes your upload key, and you should use it to sign future releases.

Summary:
Creating and using the “release” key is very similar to creating the debug key. You create both on your computer.

The “release”-key is basically just used to sign the app before uploading it to Google Play. It is only used between you and Google Play. Therefore it could also be called upload-key.

Finally:
If you run into any problems in the play store then first make sure that you completed all mandatory sections of your game listing. I read often of people that though that a warning message (after upload) stopped the release of their app but then they noticed that they forgot to fill/complete other required data in the store listing (like Content Rating, GDPR / Data Privacy, etc…).

First i created a release.keystore with that command you mentioned and then signed my app(in the keystore section of export to android by mentioning where is the release,release user,release password) and then clicked on export project,turned off the export with debug option and clicked on save. Then i uploaded this apk to the google console and got this error:https://drive.google.com/file/d/1ggbDslxq7kANhEfjNUIZihGZlt254M-V/view?usp=drivesdk.
How can i fix the error. Please help. And again thank you for your precious time and reply.

App_develooer | 2020-03-11 06:39

Ok, it seems that the app signing failed.

Check the Godot output window for any error messages concerning the jarsigner.
If you’re on windows you might want to increase the number of rows in the output window (Upper left corner → Settings → layout → Window buffer size → height → 8000) to make sure that messages will still be visible.

wombatstampede | 2020-03-11 07:12

EXTREMELY THANKYOU!!! I AM DONE!! I WAS SEARCHING FOR THIS FOR MONTHS AND NOW THIS IS FINALLY DONE. YOU ARE THE BOSS. ONCE AGAIN THANKYOU AND ALSO THANKYOU FOR YOUR PRECIOUS TIME AND REPLY!!

App_develooer | 2020-03-12 14:02

Thank you for the feedback!

Could you tell me/us what/why your signing failed previously?

wombatstampede | 2020-03-12 15:01

I didnt turned on the “signed” option when exporting to android. Thank you again!

App_develooer | 2020-03-13 05:14

After successfully uploading to google developer console, i tried to run that apk on an android device, but it is not opening. Whenever i click, it just flips the screen(because my game is landscape) and then the game closes. In short, it is not opening. Why isint it opening and whats the problem? Please help.

App_develooer | 2020-03-13 05:46