+1 vote

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.

Godot version 3.2.2
in Engine by (30 points)
edited by

2 Answers

+4 votes
Best answer

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: https://developer.android.com/studio
OpenJDK: https://adoptopenjdk.net/releases.html?variant=openjdk15&jvmVariant=hotspot

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 INSTALLPARSEFAILEDNOCERTIFICATES 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!

by (30 points)
edited by

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.

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): https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_android.html

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: https://www.oracle.com/java/technologies/downloads/#jdk17-windows

(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)

0 votes

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): https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_android.html

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: https://www.oracle.com/java/technologies/downloads/#jdk17-windows

(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)

by (14 points)
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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.