godot: The default Godot 4.2.1 application crashes in compatible mode on the Redmi 4X with OpenGL ES 3.2
Here is my topic on the Godot forum: https://forum.godotengine.org/t/run-time-error-on-android/36928
Tested versions
Godot 4.2.1 in compatible mode:
System information
Window 10, Redmi 4X (OpenGL ES 3.2)
I wrote a simple application in Qt that shows an OpenGL version:
Issue description
The application crashes on the Redmi 4X with the message:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mygame/com.godot.game.GodotApp}: java.lang.IllegalStateException: Unable to initialize engine native layer
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2723)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2784)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1523)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6238)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:933)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
Caused by: java.lang.IllegalStateException: Unable to initialize engine native layer
at org.godotengine.godot.GodotFragment.performEngineInitialization(GodotFragment.java:191)
at org.godotengine.godot.GodotFragment.onCreate(GodotFragment.java:182)
at androidx.fragment.app.Fragment.performCreate(Fragment.java:2949)
at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:475)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:278)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1971)
at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:311)
at org.godotengine.godot.GodotActivity.onCreate(GodotActivity.kt:84)
at com.godot.game.GodotApp.onCreate(GodotApp.java:45)
at android.app.Activity.performCreate(Activity.java:6857)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2676)
... 9 more
Steps to reproduce
Build to the device with OpenGL ES 3.2. In my case I use Redmi 4X
Minimal reproduction project (MRP)
About this issue
- Original URL
- State: closed
- Created 6 months ago
- Comments: 30 (17 by maintainers)
If you run project in pc with F5 key,it will let you select main scene.
I was able to run it with your project after exporting it, but not with the apk you provided, it pops up a popup like yours. After comparing the two apk files, I realized that you didn’t set the main scene to run, and the scene is missing from your apk.
@8Observer8 a pull request was just created here.
I will soon create a
DraftPull Request as soon as I have found a solution for the GL-Context problem. https://github.com/godotengine/godot/issues/86112#issuecomment-1898564926So far we have tried 2D projects, we still need to test 3D projects with
spot light + shadowhttps://github.com/godotengine/godot/issues/86112#issuecomment-1896098062@joined72 if you have time: https://github.com/godotengine/godot-demo-projects
Note: not all projects are optimized for OpenGL ES3. There are also Vulkan demos that do not work as they should on Android.
Yes, it works on Redmi 4X! I think Godot 4.2.2 will not have this bug. When 4.2.2 will be released?
@8Observer8 I have just fixed a bug that could be strict related to your, can you test the following .APK file and tell to me if works fine, please?
GLES3_Test.apk
From my tests on an old Android devices that works fine on GLES3 on others apps and crashes on Godot 4, I think the real problem with GLES3 Rendering AREN’T the old Android devices GLES buggy drivers, as many developers states, but a Godot initialization bugs of the GLES3 Rendering.
I’m currently working on the “Wrong Rotation Bug” but I will try to do my best on this too.
Seems like the APK are trying to using an Android 11 WindowInsetsAnimation API on an old Android version. I found a similar bug too. I think this would be to investigate too.
PS: currently I’m out of my office where I have some logcat with many of those errors occurred.
Unable to initialize engine native layerI could not find (result.zip)logcat
You could still try ‘OpenGL Debug’, maybe we will see more when the problem with the “native layer” is solved.