Godot: Game fails to run on Android: shows Godot logo, disappears, repeats

Created on 2 Apr 2019  路  12Comments  路  Source: godotengine/godot

Godot version: 3.1
OS/device including version: Xiaomi Redmi 4
Issue description: When I build/run the Android version of my game, I see the following behaviour:

  • Godot splash logo appears
  • Logo disappears in <= 100ms
  • This cycle repeats roughly 4-5x

I tried to capture adb catlog to a text file. I think this is the relevant part:

04-01 08:04:18.672  1384  1394 I ActivityManager: START u0 {act=android.intent.action.MAIN flg=0x10000000 cmp=com.deengames.controlyourtongue/org.godotengine.godot.Godot} from uid 2000 on display 0
04-01 08:06:13.069  1384  1426 E PackageInstaller: Commit of session 566684875 failed: Failed to collect certificates from /data/app/vmdl566684875.tmp/base.apk: Attempt to get length of null array

I tried two different keystores to be sure I have the right user/password combination.

bug android porting

Most helpful comment

I wrote a blog post about this today, and I realized that this seems like a genuine Godot bug. Using preload crashes, but using load doesn't.

Is this expected, or is this a real issue?

All 12 comments

GLES version?
If you see the logo it is usually related to the renderer, other errors (key or not common characters on filename) fail on install.

I tried GLES2 and GLES3. Same behaviour. These error logs are from GLES3.

I have the same problem. Both GLES2 and GLES3 too. Working with Light2D and Shadows (which produce in another game a black screen on GLES2 btw. Maybe related?).

I downgraded my (simple) project to Godot 3.0.6 to see if that's a work-around. It's not; I didn't check the catlog, but the behaviour of the application is exactly the same (logo appears/disappears).

I now suspect my application code, since I was able to make Android apps work with 3.0.6 in the past. I'll experiment more and see if I can figure this out.

I made a vanilla 3.0.6/3.1 Android app (single scene with a single image). For 3.1, I get the same thing @Noisefever reported: empty/black screen regardless of GLES version. For 3.0.6, the app crashes.

Can anyone suggest a work-around or solution? I think it's my environment that's broken.

I found a partial solution. It looks like my dummy project didn't have a Main Scene specified in the project settings (under Run). Although this allowed me to run it on Windows, it crashed on Android.

Specifying a main scene fixed the problem. This applies to both 3.0.6 and 3.1. @Noisefever, does this fix your issue too?

However, my main (broken) project already has a main scene specified; this isn't the reason it's broken.


After debugging further, it looks like something strange/broken with my main scene. If I create a dummy scene in that project, with just a sprite, it loads/runs fine on my phone. I'm going to debug further and figure out if it's a Godot issue or not; if you don't hear back from me in a couple of weeks, please close it.

@nightblade9 no, unfortunately not. I have a Main Scene.

I debugged further and found that my issue is that I preload the same resource twice.

  • Main scene preloads Second.tscn and HelperScript.gd
  • Second scene also preloads HelperScript.gd
  • This is what caused the behaviour.

I think Godot can do the following:

  • Fail when I run it on PC, the same way it fails when I run it on Android. That way, as a developer, I can be confident that my game works when it works on PC, and I can find problems sooner than later.
  • Output a warning or error about this problem in the Editor. I checked; there are no warnings about this.

The two work-arounds I found:

  • Make HelperScript.gd an autoload singleton instead
  • Use load instead of preload

I solved my problem with the not starting game: it was the broken "Tiled Map Importer" addon.
However: this and the other game still showing a black screen in GLES2, when Light2D is in the scene.

GLES2 and Light2D: had to change the Environment from "Canvas" to "Custom Clear Color". Obviously there was a change that I have missed. Sorry! All functional now.

I wrote a blog post about this today, and I realized that this seems like a genuine Godot bug. Using preload crashes, but using load doesn't.

Is this expected, or is this a real issue?

Can you make a sample project to reproduce the problem consistently?

It doesn't reproduce any more - not on the original project, and not in a brand-new project.

I'm going to close this issue for now. If I can find a repro case, I will come back to this again and we can investigate more.

Was this page helpful?
5 / 5 - 1 ratings