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:
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.
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.
Second.tscn and HelperScript.gdHelperScript.gdI think Godot can do the following:
The two work-arounds I found:
HelperScript.gd an autoload singleton insteadload instead of preloadI 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.
Most helpful comment
I wrote a blog post about this today, and I realized that this seems like a genuine Godot bug. Using
preloadcrashes, but usingloaddoesn't.Is this expected, or is this a real issue?