0 votes

Hi!
I found a way to verify if an apk is signed or not, and tested with an apk debug version from Godot, an apk release version from Godot and a random apk game from internet. Both of my builds were unsigned, so Android doesn't allow to install them ("The app was not installed"), and it doesn't work with debug test either.

In the other hand, I'm pretty new on Android development, so I don't know if I previously made something wrong. Here are what I made:

Editor settings > Export > Android:
Adb: C:/Users/"user name"/AppData/Local/Android/Sdk/platform-tools/adb.exe
Jarsigner: C:/Program Files/Java/jdk-14.0.1/bin/keytool.exe
Debug keystore: C:/Users/"user name"/debug.keystore
Debug keystore user: androiddebugkey
Debug keystore password: android

Project>Export>Android>Package:
Unique name: com.coolcompany.game
Name: Game

Project>Export>Android>Keystore:
Debug: C:/Users/"user name"/debug.keystore
Debug user: androiddebugkey
Debug password: android
Release:C:/Users/user name/mygame.keystore
Release user: "the name of user"
Release password: "the password"

I didn't changed any other settings. I tested with multiple projects, all give the same problem.
Godot Version: 3.2
Android Studio: 4.0

asked Jun 8 in Engine by Lfzinho (29 points)

1 Answer

0 votes
Best answer

It's very difficult to know what is wrong without the output of your Gradle build. Could you provide this, as it has information if something went wrong with signing, and if it was with release or debug keys.

Also, if you are trying to sign with the release key, be sure to uncheck the "Export With Debug" checkbox in the Project -> Export -> Android -> Export Project screen below the "file name" input.

answered Jun 8 by jtarallo (376 points)
selected Jun 8 by Lfzinho

I'm not sure if this is Gradle, but that is what the "Godot second black window" says:

ADDING: AndroidManifest.xml
ADDING: classes.dex
ADDING: lib/arm64-v8a/libc++shared.so
ADDING: lib/arm64-v8a/libgodot
android.so
ADDING: lib/armeabi-v7a/libc++shared.so
ADDING: lib/armeabi-v7a/libgodot
android.so
ADDING: res/drawable-hdpi-v4/notificationbglownormal.9.png
ADDING: res/drawable-hdpi-v4/notification
bglowpressed.9.png
ADDING: res/drawable-hdpi-v4/notificationbgnormal.9.png
ADDING: res/drawable-hdpi-v4/notificationbgnormalpressed.9.png
ADDING: res/drawable-hdpi-v4/notify
panelnotificationiconbg.png
ADDING: res/drawable-mdpi-v4/notification
bglownormal.9.png
ADDING: res/drawable-mdpi-v4/notificationbglowpressed.9.png
ADDING: res/drawable-mdpi-v4/notification
bgnormal.9.png
ADDING: res/drawable-mdpi-v4/notification
bgnormalpressed.9.png
ADDING: res/drawable-mdpi-v4/notifypanelnotificationiconbg.png
ADDING: res/drawable-v21/notificationactionbackground.xml
ADDING: res/drawable-xhdpi-v4/notificationbglownormal.9.png
ADDING: res/drawable-xhdpi-v4/notification
bglowpressed.9.png
ADDING: res/drawable-xhdpi-v4/notificationbgnormal.9.png
ADDING: res/drawable-xhdpi-v4/notificationbgnormalpressed.9.png
ADDING: res/drawable-xhdpi-v4/notify
panelnotificationiconbg.png
ADDING: res/drawable-xxhdpi-v4/notify
panelnotificationiconbg.png
ADDING: res/drawable/notification
bg.xml
ADDING: res/drawable/notificationbglow.xml
ADDING: res/drawable/notificationiconbackground.xml
ADDING: res/drawable/notificationtilebg.xml
ADDING: res/layout-v16/notificationtemplatecustombig.xml
ADDING: res/layout-v21/notification
action.xml
ADDING: res/layout-v21/notificationactiontombstone.xml
ADDING: res/layout-v21/notificationtemplatecustombig.xml
ADDING: res/layout-v21/notification
templateicongroup.xml
ADDING: res/layout/downloadingexpansion.xml
ADDING: res/layout/notification
action.xml
ADDING: res/layout/notificationactiontombstone.xml
ADDING: res/layout/notificationtemplateicongroup.xml
ADDING: res/layout/notification
templatepartchronometer.xml
ADDING: res/layout/notificationtemplateparttime.xml
ADDING: res/layout/status
barongoingeventprogressbar.xml
ADDING: res/mipmap-anydpi-v26/icon.xml
ADDING: res/mipmap-hdpi-v4/icon.png
ADDING: res/mipmap-hdpi-v4/iconbackground.png
ADDING: res/mipmap-hdpi-v4/icon
foreground.png
ADDING: res/mipmap-mdpi-v4/icon.png
ADDING: res/mipmap-mdpi-v4/iconbackground.png
ADDING: res/mipmap-mdpi-v4/icon
foreground.png
ADDING: res/mipmap-xhdpi-v4/icon.png
ADDING: res/mipmap-xhdpi-v4/iconbackground.png
ADDING: res/mipmap-xhdpi-v4/icon
foreground.png
ADDING: res/mipmap-xxhdpi-v4/icon.png
ADDING: res/mipmap-xxhdpi-v4/iconbackground.png
ADDING: res/mipmap-xxhdpi-v4/icon
foreground.png
ADDING: res/mipmap-xxxhdpi-v4/icon.png
ADDING: res/mipmap-xxxhdpi-v4/iconbackground.png
ADDING: res/mipmap-xxxhdpi-v4/icon
foreground.png
ADDING: res/mipmap/icon.png
ADDING: res/mipmap/iconbackground.png
ADDING: res/mipmap/icon
foreground.png
Unicode error: invalid skip
Unicode error: invalid skip
Unicode error: invalid skip
Unicode error: invalid skip
Unicode error: invalid skip
Unicode error: no space left
ADDING: resources.arsc
erasing C:\Users\lagua\AppData\Local\Temp/Godot/tmpproject.binary
0 param: --xrmoderegular
1 param: --usedepth32
2 param: --use_immersive
Illegal option: -digestalg
Key and Certificate Management Tool

Commands:

-certreq Generates a certificate request
-changealias Changes an entry's alias
-delete Deletes an entry
-exportcert Exports certificate
-genkeypair Generates a key pair
-genseckey Generates a secret key
-gencert Generates certificate from a certificate request
-importcert Imports a certificate or a certificate chain
-importpass Imports a password
-importkeystore Imports one or all entries from another keystore
-keypasswd Changes the key password of an entry
-list Lists entries in a keystore
-printcert Prints the content of a certificate
-printcertreq Prints the content of a certificate request
-printcrl Prints the content of a CRL file
-storepasswd Changes the store password of a keystore
-showinfo Displays security-related information

Use "keytool -?, -h, or --help" for this help message
Use "keytool -commandname --help" for usage of commandname.
Use the -conf option to specify a pre-configured options file.
Illegal option: -verify
Key and Certificate Management Tool

Commands:

-certreq Generates a certificate request
-changealias Changes an entry's alias
-delete Deletes an entry
-exportcert Exports certificate
-genkeypair Generates a key pair
-genseckey Generates a secret key
-gencert Generates certificate from a certificate request
-importcert Imports a certificate or a certificate chain
-importpass Imports a password
-importkeystore Imports one or all entries from another keystore
-keypasswd Changes the key password of an entry
-list Lists entries in a keystore
-printcert Prints the content of a certificate
-printcertreq Prints the content of a certificate request
-printcrl Prints the content of a CRL file
-storepasswd Changes the store password of a keystore
-showinfo Displays security-related information

Use "keytool -?, -h, or --help" for this help message
Use "keytool -commandname --help" for usage of commandname.
Use the -conf option to specify a pre-configured options file.
erasing C:\Users\lagua\AppData\Local\Temp/Godot/tmpexport-unaligned.apk

Yeah man, something is wrong with the Key Tool:

Illegal option: -digestalg
Key and Certificate Management Tool

You should google a bit what can be wrong, maybe the wrong version? Or something wrong with Java? I got this to work with alot of trial and error, googling errors which turned up there in the output. Just be on the lookout for those until you get it to click. At least now you know the issue is with that tool in particular.

Thanks! Just one last question: I checked the keytool files and -digestalg is "\jarsigner" command, not a "\keytool" one, so that means this message should appear for everyone?
By the way, I changed my JDK from Oracle to Open JDK but it stills the same, maybe reinstall Godot would work?

https://ibb.co/pb6KpBp

On the left you have the screenshot of the part which is failing for you, and on the right you have the bottom of the output of my game build for android, which states it is correctly signed and my information.

I highly doubt re-installing godot will work. It has definately something to do with your android dev environment, sdk etc. Be sure to follow the steps in the godot setup guide for android to the letter. There are also some stuff which needs to be described better maybe, as I recall having issues with signing also, and doing alot of googling around and trying out several android sdk downloads to get it to work.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.