[4.0b3 - 4.0RC2] Black Screen and Screen Tearing on Android
- Edited
snowy-fox According to GSMArena the Galaxy S9 was released with Android 8.0 but is "upgradable" to 10 so I assume DaveTheCoder is updated to latest available for it.
- Edited
snowy-fox which version of Android does your Galaxy S9 run?
My phone is running Android 10.
If you want to upload a minimal project that fails on Android, I could try exporting it to Android. I don't know if that would help.
Or you could try using adb and logcat to debug it.
https://godotforums.org/d/31588-app-in-mobile-crashes-after-i-try-to-open-the-app-on-the-second-time/2
- Edited
DaveTheCoder It certainly couldn't hurt to try. It'd be good extra insight to try running my build on Android 10 - which I don't have access to myself - and to try exporting from my project on your machine.
I've made a zip file with both my Android build and the project folder in it.
Thanks for offering.
(EDIT
(Holy crap, that's a big preview box!!!)
- Edited
When I uploaded a .zip to a post here (after the forum software had been upgraded), there was no preview at all. I had to edit the post and change an image tag to a plain link so that the .zip could be downloaded.
I imported your project into Godot 4.0-beta4, connected my computer to my phone with a USB cable and clicked the Android icon in Godot. The project exported to the phone and runs properly, i.e. it displays the 5.png image just like the Godot editor.
I also tried installing your .apk on the phone from the command line, and that worked too:
adb install snowys_android_test.apk
When I first imported the project into Godot, there was a warning dialog about res://5.png. I clicked the close-button, and the project ran normally within the editor.
There are other warning messages:
modules/gltf/register_types.cpp:76 - Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
modules/gltf/register_types.cpp:100 - FBX file import is enabled in the project settings, but no FBX2glTF path is configured in the editor settings. FBX files will not be imported.
But none of the warnings seem to affect anything.
- Edited
For further testing, you could try this. It's a simple 4.0-beta4 project I made with a Sprite and a Label. The project folder includes an exported .apk.
https://www.dropbox.com/s/t0y1jki2xajmaln/test_for_snowy.zip?dl=0
- Edited
DaveTheCoder When I uploaded a .zip to a post here (after the forum software had been upgraded), there was no preview at all. I had to edit the post and change an image tag to a plain link so that the .zip could be downloaded.
It's an auto-embed form a google drive share link. zip files usually get presented as a directory listing and the download link can be found when visiting the page opened by pressing the icon to the top right. But in this case the zip for whatever reason can't be presented as a directory listing of the contents so it's offering the download link directly.
DaveTheCoder Thanks for all your help so far.
I first downloaded your project and APK, and tried installing the APK on my devices. Strangely, it failed to even so much as install on either of them.
The project loaded fine in my Godot editor (those warnings seem to happen a lot when importing projects - I've been getting them the whole time I've been using the Godot 4 beta) and I was able to test it on my PC. Exporting an APK and installing it onto my Android devices worked, but the same as with my own projects, running it didn't - I had the same black screen on both. As before, on the Retroid, the Godot splash was shown, then a moment of black screen, and then there was a crash.
This is still helpful, though, as it's helped to narrow down the issue. As far as I can see, either Godot 4 is currently exporting files that my particular Android devices - or perhaps versions of the Android software below Android 10 - don't like, or there is something horribly wrong with my Godot settings or installation. But, if the latter is the case, I find it strange that your APK refuses to install on my devices, and that my APK installs and runs just fine on yours, so I'm inclined to believe the exports are being picky about which devices or Android versions they want to play ball with.
In short, I'm pretty sure at this point that it's just a compatibility issue.
I'm not sure we're going to be able to get any further unless somebody who knows a lot more about Godot 4's Android compatibility finds the thread and chips in. For now, I'm just going to soldier on with my project, accept that I won't be testing it on my Retroid any time soon, and hope future versions of Godot 4 come with better Android compatibility (or someone is able to work out what's wrong here, if it's not that).
Again, thanks, Dave, for all of your help.
snowy-fox either Godot 4 is currently exporting files that my particular Android devices - or perhaps versions of the Android software below Android 10
I bet on this being the case. As godot 4 matures maybe android 8 & 9 become supported, but I suspect the core developers might consider these old enough to be legacy.
- Edited
snowy-fox I'm not sure we're going to be able to get any further unless somebody who knows a lot more about Godot 4's Android compatibility finds the thread and chips in.
You could also look through the posted issues for possible clues.
https://github.com/godotengine/godot/issues?page=2&q=is%3Aissue+android+in%3Atitle
If you don't find anything relevant, you could post a new issue, and include a minimal reproduction project and a link to this thread.
Megalomaniak I really hope that's not the case. The Retroid Pocket 2+ is just one of many "retro handhelds" that run on Android - often older versions, presumably for lightness - which are becoming very popular. Not supporting Android 8 and 9 would be locking Godot 4 off from those devices, not to mention people who just have older phones, which is a whole other, probably much bigger potential player base.
Though looking at the issues on GitHub, as mentioned below, it looks like the devs are investigating the issue and trying to find solutions.
DaveTheCoder Yeah, good call. I didn't create a new issue, as others are clearly having similar problems - I added a brief explanation and a link to this thread into a post in https://github.com/godotengine/godot/issues/63943
snowy-fox Not supporting Android 8 and 9 would be locking Godot 4 off from those devices
Yes, but the idea is likely for Godot 3 to see some continued support for at least a few years after Godot 4 gets a stable release.
- Edited
Update: after updating to Godot 4.0 beta 5, the issue still persists, with no change.
EDIT
Progress, though. If I switch the renderer to OpenGL, rather than crashing, it now gives this error on my Retroid:
EDIT
And the same on my phone.
While it's still not working, it at least feels like a step forwards.
Update: exported from Godot 4.0 beta 7, the issue is back to being a black screen following the Godot splash, this time on both devices - the game no longer crashes on the Pocket 2+, but there are no visuals. I'll test again once I've added some sound effects to find out whether the game is actually running amidst the infinite darkness.
This page seems to indicate that Vulkan was available starting with Android 7.0
https://developer.android.com/ndk/guides/graphics/getting-started
However, that does not guarantee that your particular device has a SoC with a GPU that supports Vulkan, and, additionally, a Vulkan compatible graphics driver.
All those things would need to be current for it to work. I've found some devices from even a few years ago don't support OpenGL ES3, so you can forget Vulkan.
Download the app GPU Info, and find the model number of the CPU/GPU (usually one unit, the SoC). Then put that into this website: https://www.notebookcheck.net
It will tell you which OpenGL/Vulkan versions are supported.
cybereality Yup, OpenGL ES3 had issues on these devices exporting from Godot 3.x, too, and I had to use ES2, or there would be visual errors. At this point, I'm just reporting my findings in the hopes that it might help other people having similar issues, and that better backwards compatibility for software and hardware used by these popular devices - particularly the Android-based retro handhelds - will be included in future Godot 4.x releases.
- Edited
I have a RG552, which does support GLES 2/3 and Vulkan. But it's on the high end of retro handhelds, I think it cost over $200 when I bought it.
I tried one of my GLES3 demos and it works, not very fast, but it loaded without glitches. I didn't try Vulkan, cause I was having problems exporting. But I tried Vulkan on some emulators, and it worked.
cybereality It certainly seems very hit and miss at the moment as to which devices happen to have the right gubbins to run what Godot 4's putting out. It's unfortunate, but I'm just gonna sit tight and wait to test my project on Android if and when a build comes out that works on my devices.
As for GLES3, on the Pocket 2+, exported from Godot 3.x, I was having a weird screen tearing issue. where one half of the screen was lagging about ten or twenty frames behind the other. GLES2 worked just fine - as well as on PC, with the li'l project I had at the time - but ideally, I'd like to be able to stick to Godot 4 moving forward, since that's the direction support is moving in in the long term, so that's what I'm slightly stubbornly building my "big" game in.
Honestly, I'm not sure what the best idea is. Godot 3.x is very stable and well supported. Godot 4.0 is somewhat okay on desktop, but there are still lots of glitches and crashes with the editor. And I'm considering mobile and/or web for my game, and the support right now is not even usable. It may be 6 months, maybe a year, before it is solid and production ready. It could be a good investment, if you are working on something in the 1 year time frame, but it could also be a lot of headache and risk when 3.x works fine right now. I'm not sure what the right answer is.