Can't Deploy Android App (INSTALL_PARSE_FAILED_NO_CERTIFICATES)

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

I was working on a mobile game some months ago and deploying regularly through Godot. No problems. Recently I was trying to upload the .APK and distribute it, so I uninstalled the app from my phone and tried to install via the .APK, but this didn’t work. I went back to deploying directly through Godot so I could see the error(s) in the console:

> adb: failed to install
> C:\Users\Oliver\AppData\Local\Temp/Godot/tmpexport.apk: Failure
> [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates
> from /data/app/x.tmp/base.apk: Attempt to get length of
> null array] Starting: Intent { act=android.intent.action.MAIN
> cmp=com.companytest.androiddeploymenttest123/com.godot.game.GodotApp }
> Error type 3 Error: Activity class
> {com.companytest.androiddeploymenttest123/com.godot.game.GodotApp}
> does not exist.

I’ve read through this and it seems to me that Godot is searching my phone to find the base version of the application, then updating it before deploying. It can’t find the base version, because I already uninstalled it, but I can’t install it again, because it can’t find the base version. Classic catch-22 situation.

My question is this- can I force Godot to do a “fresh” deployment/install? I thought I’d be able to do this by updating the package name to something unique, but that made no difference. I am using the debug.keystore in multiple (working) applications, so I don’t think there is a conflict there. The project has access to the ADB, JarSigner & KeyStore (like I said this was working before, and works for other applications that I didn’t uninstall).

I made another app and went through the same process and I can confirm that this error definitely starts happening when I uninstall the application from the Android device.

I suspect there are some files hanging around somewhere that tells Godot that the application has already been deployed to this device, but it’s just a guess and even if it’s correct I don’t know where those files are.

Pretty stumped on this one, so any help is appreciated. Thanks.

:bust_in_silhouette: Reply From: ojn17041991

I finally got this fixed. I’m afraid I don’t exactly have a satisfying answer, but it is an answer nonetheless. I tried my best to isolate the root cause, but nothing I tried seemed to make any difference, so in the end I made a last-ditch effort and reinstalled Android Studio and OpenJDK. For those facing the same issue, I downloaded them from here:

Android Studio: Descarga Android Studio y App Tools - Android Developers  |  Android Studio
OpenJDK: Latest release | AdoptOpenJDK - Open source, prebuilt OpenJDK binaries

Once I updated my Editor Settings with the new directories for the ADB, JarSigner, KeyStore and SDK, the build finally went through.

This is a bit of a difficult issue to figure out, so I hope this can be of some help to someone.

EDIT:

My initial question states that this issue started happening when deleting the application on Android and attempting to re-install. Worth pointing out that this is not actually true. Even brand new Android projects were failing. I can only assume that something was automatically updated on my machine at some point and I wasn’t aware (like I said it’s been months since I worked on this project).

If you’re facing this problem, I would probably try a few other things before resorting to reinstalling everything. From what I can tell, the INSTALL_PARSE_FAILED_NO_CERTIFICATES error pertains specifically to the signing of your application. As such, you would first want to double check your Editor Settings for any basic errors:

  1. Are all your Android directories valid?
  2. Does your keystore have the correct credentials? If you’re not sure, delete it and create a new one.
  3. Are you exporting to Debug with a Release KeyStore or vice versa?
  4. Is your JarSigner directory targetting jar.exe instead of jarsigner.exe?
  5. Do any of your project files contain any non-alphanumeric characters? This is not a problem I faced, but I’ve seen it multiple times today so it’s worth mentioning.

Only try re-installing as a last resort. I tried to include all the helpful information I could, but I’m not an expert by any means. Hope this helps!

Great answer!!!
But for those who failed everything else (like me, who knows what I did wrong) - (maybe the most violent option possible :D) a factory reset worked for me.

godot.ma.desive.logo | 2021-05-03 05:47

EDIT:

I realized that I had a lower version of Android SDK Build-Tools installed as well as the one specified in the docs (30.0.3): Exporting for Android — Godot Engine (stable) documentation in English

By running Godot through the command line with --verbose I noticed that when I tried to deploy for Android, bat scripts from version 29 of the build-tools were called instead of those from version 30.

Removing Android SDK Build-Tools version 29 from Android Studio SDK Manager solved it for me.

ORIGINAL MESSAGE:

I faced the same issue with Godot version 3.4.2 (also 3.3.4 and 3.3 but not with Godot 3.2.3).

I tried to reinstall android studio and openjdk as you suggested to no avail, what actually worked for me was to install the oracle jdk: Java Downloads | Oracle

(which I think needed a subscription until recently but became free to use on september 2021: https://blogs.oracle.com/java/post/free-java-license)

mrkdji | 2022-02-17 00:00

:bust_in_silhouette: Reply From: mrkdji

EDIT:

I realized that I had a lower version of Android SDK Build-Tools installed as well as the one specified in the docs (30.0.3): Exporting for Android — Godot Engine (stable) documentation in English

By running Godot through the command line with --verbose I noticed that when I tried to deploy for Android, bat scripts from version 29 of the build-tools were called instead of those from version 30.

Removing Android SDK Build-Tools version 29 from Android Studio SDK Manager solved it for me.


ORIGINAL MESSAGE:

I faced the same issue with Godot version 3.4.2 (also 3.3.4 and 3.3 but not with Godot 3.2.3).

I tried to reinstall android studio and openjdk as you suggested to no avail, what actually worked for me was to install the oracle jdk: Java Downloads | Oracle

(which I think needed a subscription until recently but became free to use on september 2021: https://blogs.oracle.com/java/post/free-java-license)

:bust_in_silhouette: Reply From: juankz

I have the same problem, my solution is to sign the apk manually:

apksigner sign --ks <keystore_path> --ks-key-alias <key_alias> <your_apk>