浏览代码

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;
Sam Lantinga 7 年之前
父节点
当前提交
a0b3dcc26a
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      android-project/app/src/main/java/org/libsdl/app/SDLActivity.java

+ 1 - 1
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;
     }
 
     /**