[Commits] SDL: Fixed bug 4002 - Android, nativeRunMain() fails on some pho...

libsdl.org revision control commits-owner at libsdl.org
Wed Sep 5 15:55:49 PDT 2018


details:   https://hg.libsdl.org/SDL/rev/d9e69bf4c6d4
changeset: 12177:d9e69bf4c6d4
user:      Sam Lantinga <slouken at libsdl.org>
date:      Wed Sep 05 15:54:46 2018 -0700
description:
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;

diffstat:

 android-project/app/src/main/java/org/libsdl/app/SDLActivity.java |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 1bc855492aaf -r d9e69bf4c6d4 android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
--- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java	Wed Sep 05 15:28:06 2018 -0700
+++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java	Wed Sep 05 15:54:46 2018 -0700
@@ -121,7 +121,7 @@
         } else {
             library = "libmain.so";
         }
-        return library;
+        return getContext().getApplicationInfo().nativeLibraryDir + "/" + library;
     }
 
     /**


More information about the commits mailing list