Deploying to older version of android/old phones

Hi there,

I’m trying to get myself set up to build a project for older android devices, currently using just the top down example map as a test and having no luck. I’ve confirmed that the map launches on a modern Huawei P30 lite running Android version 10 so i think i followed the steps for the android SDK correctly.

I have two old phones to deploy for, one Samsung Galaxy S3 mini running Android 4.1.2, and a Samsung Galaxy J5 running 6.0.1, which I believe and the most recent version of android that each device can run. The ideal outcome is i can build the game to run on both devices.

When trying to launch the map on the J5 it compiles and I get the first splash screen but then it quits to the home screen, whilst the ue4 console reads out an exception to do with OpenGLdrivers:

Assertion failed: !GPUFamily.IsEmpty() [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/OpenGLDrv/Private/Android/AndroidOpenGLPrivate.h] [Line: 64]

When trying to build to the S3 it tells me “the minimum SDK number is higher than the Android version installed on the device.”

I gathered from some reading that the first error is to do with the difference between the current OpenGL ES3.1 and the old 3.0, but no further info on how to fix it. With the S3 error I imagine i’d have to set my minimum version lower and also maybe point to some older version of the SDK instead but I have no idea.

Does anyone have the patience to help me?

Any help of any kind very much appreciated,
H

OpenGL ES2 support was removed with UE 4.25 > link

More on > OpenGL ES

Check the sections “Android SDK Version” and “Project SDK Override” > here

So, you have to use UE 4.24 to be able to deploy to Android devices lower than Android 4.3.

Thanks for your response! - so I tried installing engine version 4.24 and followed some steps for installing codeworks to package to android for it. I get a successful build and now when trying to launch on the J5 I get an error message telling me that the app is packaged for OpenGL eS 3.1 but my device only supports ES2.

I get that I have to override the SDK and NDK API Levels in the 'Project SDK Override, section of the Project Settings but i’m not sure what I need to put there. I get that I need to put the API level of the OS i’m targeting in the SDK field, but for NDK i’m not so sure, is it android-xx and if so how to match the SDK number? Apologies if i’m being dense.

It may not be necessary to override the levels. In my setup, I am using “latest” in those fields. And the latest installed on my machine are SDK 30.0.3, NDK 23.0.75.

Google requires to target sdk level 30 to be able to publish. My target sdk version is 30 and the app works on lower levels, and even if I target level 28-29 it still packages. So, I think target sdk level doesn’t matter for packaging. On the other hand, Min SDK Version should be set to the lowest level you are expecting the app to run. Although the tooltip say not to set it lower than 19, I haven’t tested this.

Cool thanks. I don’t need to publish it to Google its only going on a few specific devices. I got it working on the J5 by unchecking the ‘support ES 3.1’ option and checking ‘support ES2’ instead. My minimum SDK is set to 9 and target set to 23. I tried changing the target to 16 to match the android number of the sm3 but it’s not displaying anything but a black screen and then quitting with a message that it stopped working. Will try to launch to it direct from the editor so i can see the log output.

If the engine log doesn’t provide info, you can use adb logcat from cmd to read the phone directly.

While the phone is connected and ready to deploy:

CMD > adb logcat -c > adb logcat > Ctrl+C to stop logcat

Ok this is the error I get, something about a library not being found?

LogPlayLevel: Error:   D/UE4     ( 8895): [GameActivity] java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1891]:  1675 could not load needed library 'libGLESv3.so' for 'libOVRPlugin.so' (load_library[1093]: Library 'libGLESv3.so' not found)
LogPlayLevel:   D/UE4     ( 8895): [GameActivity] OVRPlugin library not loaded and required!

Still looking for ES3 i think. Found this. A different engine but the guy who got that error says flashing his phone fixed it. But before that:

Edit: Game’s looking for ES3 libs because of a plugin requires it it seems. Check your plugins and disable anything related to VR, because OVR is OpenVR(?).
similar problem solved here

OculusVR yeah, found it and disabled will try again now, if it’s still not working i’ll look into how to flash the phone - thanks so much for your help!

That fixed the errors in the engine console but it stills crashes just the same - looking through the logcat (thanks for the tip) and the main error seems to be:

W/dalvikvm(13799): threadid=1: thread exiting with uncaught exception (group=0x410fc2a0)
E/AndroidRuntime(13799): FATAL EXCEPTION: MainThread-UE4
E/AndroidRuntime(13799): java.lang.NoClassDefFoundError: android.opengl.EGL14

so still OpenGl stuff I guess? the vast majority refer to this opengl.EGL14 thing so i’ll look into that. Maybe it’s also a bit much to get the sm3 to work…

My findings:

java.lang.NoClassDefFoundError: android.opengl.EGL14

  • error above means EGL14 libraries are missing.
  • EGL is an interface between OpenGL ES and android native window system.
  • S3 Mini was released in 2012
  • EGL14 was released in 2014

So I think we’re past OpenGL problems but the phone doesn’t support EGL14. And I couldn’t find how to make it so that it uses lower versions of EGL.

Ah ok got you - i couldn’t find anything about it either. I’m pretty pleased I managed to get it working on the J5 so I might just abandon the sm3 for now. Thanks so much for your help!