From a0b3dcc26aae845f6dea3d2199ab263e772dc077 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 5 Sep 2018 15:54:46 -0700 Subject: [PATCH] Fixed bug 4002 - Android, nativeRunMain() fails on some phone with arm64-v8a Sylvain The issue is totally reproducible on P8 Lite. "The dlopen() call doesn't include the app's native library directory. The behavior of dlopen() by Android is not guaranteed". Workaround in getMainSharedObject() Just replace return library; with return getContext().getApplicationInfo().nativeLibraryDir + "/" + library; --- .../app/src/main/java/org/libsdl/app/SDLActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java index df9ec8977..839624f5e 100644 --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -121,7 +121,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh } else { library = "libmain.so"; } - return library; + return getContext().getApplicationInfo().nativeLibraryDir + "/" + library; } /**