Crash on Android startup cannot locate symbol "__aeabi_memcpy"

Hi!

I have the following problem: When I run a game packaged (development) on Android I have a crash on very start with the following exception:

E AndroidRuntime: FATAL EXCEPTION: main
E AndroidRuntime: Process: pl.zompi.lmproj, PID: 12825
E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__aeabi_memcpy" referenced by "/data/app/pl.zompi.lmproj-1/lib/arm/libUE4.so"...
E AndroidRuntime: 	at java.lang.Runtime.loadLibrary(Runtime.java:372)
E AndroidRuntime: 	at java.lang.System.loadLibrary(System.java:1076)
E AndroidRuntime: 	at com.epicgames.ue4.GameActivity.<clinit>(GameActivity.java:5472)
E AndroidRuntime: 	at java.lang.Class.newInstance(Native Method)
E AndroidRuntime: 	at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317)
E AndroidRuntime: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
E AndroidRuntime: 	at android.app.ActivityThread.-wrap11(ActivityThread.java)
E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:102)
E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:148)
E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:5417)
E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
W ActivityManager:   Force finishing activity pl.zompi.lmproj/com.epicgames.ue4.GameActivity
W ActivityManager: Activity pause timeout for ActivityRecord{78cebce u0 pl.zompi.lmproj/com.epicgames.ue4.GameActivity t724 f}
I ActivityManager: Killing 11320:com.google.android.apps.fitness/u0a45 (adj 15): empty #17
D ActivityManager: cleanUpApplicationRecord -- 11320
W InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@68d79de attribute=null, token = android.os.BinderProxy@4707fe5
I ActivityManager: Process pl.zompi.lmproj (pid 12825) has died

The game run on LG Nexus 5, Android 6.0.1

I have CodeWorks 1R7u1 installed. I was using the latest SDK and NDK:

The problem has been mitigated by changing the NDK version to android-19.

Now everything works fine, but still - why is the latest NDK (which should be used, according to other answers like here: Android packaging Error: resource android:attr/fontStyle not found - Platform & Builds - Unreal Engine Forums has no required symbols?

The similar problem has been here for quite a long time: Android project crashes on start up - Platform & Builds - Unreal Engine Forums

Do You know what could cause this issue? I’d like to use the newest versions of NDK possible.

Hi Zompi,

Thanks for sharing your fix. There is definitely a problem with pre 7.0 when set to latest ndk in UE 4.21.

Looking through the pre-launch report on the android developer console, I see it fail on every device running <7.0. Trying out your fix now.

I share your concern about support. I have never received a support response from Epic. This in turns leave me disinclined to share fixes I make to the engine, because they’ll get their 5% and are providing nothing but the engine for it. This should be a partnership.

Cheers,

Alan

Hello,

I have got the exact same problem, also with a Nexus 5 running 6.0.1, but changing the NDK to android-19 did not make a difference in my case. Do you work with CodeWorks 1R6u1, or with 1R7u1 as might be the case when installing CodeWorks via the installer in the UE4.21 directory:
C:\Program Files\Epic Games\UE_4.21\Engine\Extras\AndroidWorks\Win64
In an attempt to update/fix my android software I installed 1R7u1, maybe this was not a good idea?
Would you have any other sggestions what I could do to solve this here?

Thanks

Hi.

Well, I suggest to remove all of the old stuff from previous installation (by default the C:\NVPACK directory) and then install 1R7u1 once again (or anything you’ve got in Extras).

Then make sure you set NDK to android-19 and SDK to latest. Make sure to DO THIS VIA EDITOR!

Also be careful with Android Studio if you have it installed because it updates stuff and breaks it…

And… well, it really should work.

Ok, I’m closing this topic because it seems all of the stuff I posted in the question works correctly “by design”. It is just a thing you have to do to support older versions of Android :slight_smile: