Has anyone gotten their 4.x games running on Android?

I've exported a very simple 4.0-beta2 project to Android, and it worked properly. The device is a Samsung Galaxy S9. I just tried it again using Godot 4.0-beta4, and it worked.

My notes from the first test:
Godot 4.0-beta2 testing
Exported project Angles_g4b1 to Android. I had to populate two fields in Editor Settings >> General >> Export >> Android: Android SDK Path (/home/---/Android/Sdk) and Debug Keystore (/home/---/Godot/debug.keystore). I obtained those values from Editor Settings in Godot 3.5.1. The project ran correctly on Android, although the display was too small. I fixed that by changing Project Settings >> General >> Display >> Window >> Stretch >> Mode from "disabled" to "viewport".

    DaveTheCoder Thanks for the input! I did already do everything in your notes, but haven't tried it in Godot 4 beta 4 yet - I didn't realise the new build was out. I guess watching their Twitter feed isn't enough to keep up with that.

    In case upgrading to beta 4 doesn't fix the issue, which version of Android does your Galaxy S9 run? My phone is a Huawei P10 Lite running Android 8.0. The Retroid Pocket 2+ runs Android 9.

    EDIT
    Well, I updated to 4.0 beta 4, and the result is still exactly the same on both devices.

      snowy-fox changed the title to [4.0b3 - 4.0b4] Black Screen on Android .

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

      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.

        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.

            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.

                snowy-fox changed the title to [4.0b3 - 4.0b5] Black Screen on Android .

                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.

                15 days later

                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.

                  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.