keepsafe / relinker Goto Github PK
View Code? Open in Web Editor NEWA robust native library loader for Android.
License: Apache License 2.0
A robust native library loader for Android.
License: Apache License 2.0
Hey guys great work with this library. It has resolved various crashes on our app.
We are currently getting the following issue reported by the GooglePlay dev console. Hope you guys have an idea on how to resolve it or how we can resolve it.
We have 3 shared libraries being loaded:
libffmpeg.so, libskia_android.so, and libfc.so
Architecture supported:
armeabi, armeabi-v7a, x86, and arm64-v8a
Android:
4.0.3 - 4.0.4
Log:
java.lang.UnsatisfiedLinkError: Cannot load library: find_library[1199]: 94 'libfc.so' failed to load previously
at java.lang.Runtime.load(Runtime.java:340)
at java.lang.System.load(System.java:521)
at com.getkeepsafe.relinker.SystemLibraryLoader.loadPath(SystemLibraryLoader.java:29)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:200)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:140)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:70)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:51)
at com.vblast.fclib.Config.init(Config.java:23)
at com.vblast.flipaclip.App.onCreate(App.java:59)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:973)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3968)
at android.app.ActivityThread.access$1300(ActivityThread.java:128)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1199)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4514)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(NativeStart.java)
I just want to ask something. In my project I do not use System.loadlibrary. But I use import static
and it crashes with an unsatisfiedlinkerror exception can I use relinker in this case?
ReLinker is "A robust native library loader for Android"
SoLoader is a native code loader for Android. It takes care of unpacking your native libraries and recursively loads dependencies on platforms that don't support that out of the box.
What should I choose for native library loading? What is the difference between the two?
In some android devices we are getting list of abis as
"armabi" only however the jni files we have belong to armabi-v7a folder. This is causing crash in load at in some files.
Is it possible to expose the LibraryLoader interface? so we can specify the abi folders that our app supports
Caused by com.getkeepsafe.relinker.MissingLibraryException: lib/armeabi/libjingle_peerconnection_so.so
at com.getkeepsafe.relinker.ApkLibraryInstaller.installLibrary(ApkLibraryInstaller.java:85)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:180)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:136)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:92)
I'm not using Gradle yet for our android project (for various reasons outside of my control). I'd like to use relinker with my android project.
What I figured I'd do is use gradle to build a jar
file and just put that in my libs
directory so it gets pulled in and I can use it.
I'm not having any luck building relinker though. I modified relinker/build.gradle
to set these differently:
compileSdkVersion 15
buildToolsVersion "26"
After that it fails:
$ gradle
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':relinker'.
> Failed to notify project evaluation listener.
> com.android.build.gradle.tasks.factory.AndroidJavaCompile.setDependencyCacheDir(Ljava/io/File;)V
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED in 0s
I am using a version of gradle I downloaded directly from the gradle website. I do not use Android Studio at the moment. Not sure what the issue is, hopefully you can help.
Thanks in advance.
Makes it hard to debug exactly what is wrong. The library should report at least the exception message to the logger.
Just noticed in the latest documentation you mention
If your app includes native libraries, and your minimum SDK is below API 23 (Marshmallow), you need ReLinker.
We are finding that we get java.lang.UnsatisfiedLinkError
even on Marshmallow, and ReLinker fixes the issue.
Should the documentation perhaps be your minimum SDK is API 23 *and* below
?
Hi, I am now using ReLinker to relink .so files in my project like this
ReLinker.log(logger).recursively().loadLibrary(context, "avcodec"); ReLinker.log(logger).recursively().loadLibrary(context, "jniavcodec"); ReLinker.log(logger).recursively().loadLibrary(context, "avdevice"); ReLinker.log(logger).recursively().loadLibrary(context, "jniavdevice"); ReLinker.log(logger).recursively().loadLibrary(context, "avfilter"); ReLinker.log(logger).recursively().loadLibrary(context, "jniavfilter"); ReLinker.log(logger).recursively().loadLibrary(context, "avformat"); ReLinker.log(logger).recursively().loadLibrary(context, "jniavformat"); ReLinker.log(logger).recursively().loadLibrary(context, "avutil"); ReLinker.log(logger).recursively().loadLibrary(context, "jniavutil"); ReLinker.log(logger).recursively().loadLibrary(context, "postproc"); ReLinker.log(logger).recursively().loadLibrary(context, "jnipostproc"); ReLinker.log(logger).recursively().loadLibrary(context, "swresample"); ReLinker.log(logger).recursively().loadLibrary(context, "jniswresample"); ReLinker.log(logger).recursively().loadLibrary(context, "swscale"); ReLinker.log(logger).recursively().loadLibrary(context, "jniswscale");
In some devices, it works well. However in some device like MI Note Pro (5.1.1) and HuaWei TIT-AL00 (5.1), it reports error as:
CPU info of MI Note:
CPU info of HuaWei:
So what should I do to resolve this issue? Thanks!
To specify a library version, you have to obtain a ReLinkerInstance via ReLinker.log()/ ReLinker.recursively()/ReLinker.force(). Does this seem a little arbitrary? What if I want none of those things, but do want to load with a version? I'm doing ReLinker.log(null).loadLibrary(...) in the meantime.
Keep up the good work!
There should be an API interface for System.load, which will take the library path and try to load it with System.load. If loading fails, it will try to load dependencies and try again.
We meet error like this:
java.lang.UnsatisfiedLinkError
dlopen failed: could not load library "libmegface-new.so" needed by "libMegviiFacepp-0.5.2.so.6453"; caused by library "libmegface-new.so" not found
Android Linker below M use exactly match to handle dependency. In our case, libMegviiFacepp-0.5.2.so depends on libmegface-new.so, and they were renamed to libMegviiFacepp-0.5.2.so.6453 & libmegface-new.so.6453. When linker load libMegviiFacepp-0.5.2.so.6453, it would try to load libmegface-new.so first, and then failed.
We pass "null" for "version" below Android M to avoid this.
Hi! I used ReLinker for my project to increase robust of library loading, but I faced strange crashes when I try to load my native library on 6 platform (I can not reproduce on any of my phones, it is from crashlytics)
Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/data/<apppackage>/app_lib/libmylib.so" is 32-bit instead of 64-bit
at java.lang.Runtime.load(Runtime.java:332)
at java.lang.System.load(System.java:1069)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:75)
It looks strange cuz I have only armeabi-v7a and x86 libraries in my project and appropriate abi-filter setting in gradle. Do you have any idea?
After switching to ReLinker, I recently recently received this report from one my users. It seems like if a previous call to System.load()
fails for a given library, then the library does not load in subsequent calls?
java.lang.UnsatisfiedLinkError: Cannot load library: find_library(linker.cpp:901): "/data/data/com.LearnImmersive.Lingoland/app_lib/libLingolandNativeActivity.so" failed to load previously
at java.lang.Runtime.load(Runtime.java:341)
at java.lang.System.load(System.java:500)
at com.getkeepsafe.relinker.SystemLibraryLoader.loadPath(SystemLibraryLoader.java:29)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:198)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:139)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:95)
at com.LearnImmersive.Lingoland.LingolandApplication.onCreate(LingolandApplication.java:71)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1003)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4661)
at android.app.ActivityThread.access$1300(ActivityThread.java:162)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1424)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5400)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:837)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:604)
at dalvik.system.NativeStart.main(Native Method)
I am not sure how to diagnose this one further than this. I noticed some log statements inside your library that I will be sure to remotely propagate over rsyslog in a future release.
If it helps, I also received the following information:
Android version: Android 4.2
Device: ONE TOUCH 4015X (Yaris35_GSM) 1
Manufacturer: TCT Mobile Limited (Alcatel)
Android version: Android 4.2
RAM: (MB) 512
Screen size: 320 × 480
Screen density (dpi): 160
OpenGL ES: version 2.0
Native platform: armeabi-v7a
CPU make: Mediatek
CPU model: MT6572M
Chances are I can obtain additional information from this user, but his technical knowledge is definitely average.
The method java.io.File.setReadable() is writing data in an unsafe manner, bypassing security mechanisms that would normally prevent unauthorized access.
It is useful to have very fine grained logging information, the library should provide a logging interface that users can utilize to get more in-depth information on what goes on internally.
This should probably adopt a builder-like pattern, maybe
ReLinker.log(myLogger).loadLibrary(context, "badlib");
or perhaps, just attach a logger once
ReLinker.attachLogger(myLogger);
final class SystemLibraryLoader implements ReLinker.LibraryLoader {
@Override
public String[] supportedAbis() {
if (Build.VERSION.SDK_INT >= 21 && Build.SUPPORTED_ABIS.length > 0) {
return Build.SUPPORTED_ABIS;
} else {
return new String[] {Build.CPU_ABI};
}
}
}
The else branch should be:
return new String[] {Build.CPU_ABI, Build.CPU_ABI2};
Please fix that, thank you!
Would be nice to support https://github.com/mikepenz/AboutLibraries
could you add a file similar to the one attached? (note, using that externally, for internal usage the identifier needs to be changed)
library_relinker_strings.xml.zip
Does ReLinker support android:extractNativeLibs=false ?
There are few levels of such support.
Hi guys,
i want to report a problem that occures when my App (de.komoot.android) runs on a device with your keepsafe app.
Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: library "/data/data/de.komoot.android/app_lib/librealm-jni.so" not found
at java.lang.Runtime.load(Runtime.java:333)
at java.lang.System.load(System.java:512)
at com.getkeepsafe.relinker.SystemLibraryLoader.loadPath(SourceFile:29)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(SourceFile:200)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(SourceFile:140)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(SourceFile:70)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(SourceFile:51)
at io.realm.internal.RealmCore.loadLibrary(SourceFile:89)
at io.realm.RealmConfiguration$Builder.(SourceFile:352)
at de.komoot.android.realm.KmtRealmHelper.getRealmConfiguration(SourceFile:135)
at de.komoot.android.realm.KmtRealmMigration.initialMigrationCheck(SourceFile:71)
at de.komoot.android.KomootApplication.onCreate(SourceFile:157)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4730)
at android.app.ActivityThread.access$1600(ActivityThread.java:175)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5602)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(NativeStart.java)
More Infos on crashlytics:
http://crashes.to/s/d64ee5fe96f
My App is using realm which cant load his native library so file.
It would be cool if you together with the realm guys can solve this issue.
Best regards
Arne
I use relinker lib, but it catch UnsatisfiedLinkError issue
Model:K-Touch W619
Manufacturer:unknown
Version:10
Release Version:2.3.6
ProductName:msm7627a
CPU:armeabi-v7a
java.lang.UnsatisfiedLinkError: Cannot load library: load_library[1104]: Library /data/data/com.xxxxxx/app_lib/libxxxx.so not found
Log as follow:
05-26 15:11:56.804 4747 4747 E art : No implementation found for java.lang.String com.getkeepsafe.relinker.sample.Native.helloJni() (tried Java_com_getkeepsafe_relinker_sample_Native_helloJni and Java_com_getkeepsafe_relinker_sample_Native_helloJni__)
05-26 15:11:56.805 4747 4747 D ReLinker: Beginning load of hellojni...
05-26 15:11:56.826 4747 4764 D ReLinker: Loading the library normally failed: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.getkeepsafe.relinker.sample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.getkeepsafe.relinker.sample-1/lib/x86, /data/app/com.getkeepsafe.relinker.sample-1/base.apk!/lib/x86, /vendor/lib, /system/lib]]] couldn't find "libhellojni.so"
05-26 15:11:56.826 4747 4764 D ReLinker: at java.lang.Runtime.loadLibrary(Runtime.java:367)
05-26 15:11:56.826 4747 4764 D ReLinker: at java.lang.System.loadLibrary(System.java:1076)
05-26 15:11:56.826 4747 4764 D ReLinker: at com.getkeepsafe.relinker.SystemLibraryLoader.loadLibrary(SystemLibraryLoader.java:24)
05-26 15:11:56.826 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:163)
05-26 15:11:56.826 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance.access$000(ReLinkerInstance.java:31)
05-26 15:11:56.826 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance$1.run(ReLinkerInstance.java:142)
05-26 15:11:56.826 4747 4764 D ReLinker: at java.lang.Thread.run(Thread.java:818)
05-26 15:11:56.826 4747 4764 D ReLinker: hellojni (1.0) was not loaded normally, re-linking...
05-26 15:11:56.826 4747 4764 D ReLinker: yuxiang getWorkaroundLibFile: /data/user/0/com.getkeepsafe.relinker.sample/app_lib/libhellojni.so.1.0
05-26 15:11:56.826 4747 4764 D ReLinker: Forcing a re-link of hellojni (1.0)...
05-26 15:11:56.827 4747 4764 D ReLinker: Looking for lib/x86/libhellojni.so in APK...
05-26 15:11:56.827 4747 4764 D ReLinker: Found lib/x86/libhellojni.so! Extracting...
05-26 15:11:56.834 4747 4764 D ReLinker: Beginning load of hello...
05-26 15:11:56.834 4747 4764 D ReLinker: Loading the library normally failed: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.getkeepsafe.relinker.sample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.getkeepsafe.relinker.sample-1/lib/x86, /data/app/com.getkeepsafe.relinker.sample-1/base.apk!/lib/x86, /vendor/lib, /system/lib]]] couldn't find "libhello.so"
05-26 15:11:56.834 4747 4764 D ReLinker: at java.lang.Runtime.loadLibrary(Runtime.java:367)
05-26 15:11:56.834 4747 4764 D ReLinker: at java.lang.System.loadLibrary(System.java:1076)
05-26 15:11:56.834 4747 4764 D ReLinker: at com.getkeepsafe.relinker.SystemLibraryLoader.loadLibrary(SystemLibraryLoader.java:24)
05-26 15:11:56.834 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:163)
05-26 15:11:56.834 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:136)
05-26 15:11:56.834 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:92)
05-26 15:11:56.834 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:190)
05-26 15:11:56.834 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance.access$000(ReLinkerInstance.java:31)
05-26 15:11:56.834 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance$1.run(ReLinkerInstance.java:142)
05-26 15:11:56.834 4747 4764 D ReLinker: at java.lang.Thread.run(Thread.java:818)
05-26 15:11:56.834 4747 4764 D ReLinker: hello (null) was not loaded normally, re-linking...
05-26 15:11:56.834 4747 4764 D ReLinker: yuxiang getWorkaroundLibFile: /data/user/0/com.getkeepsafe.relinker.sample/app_lib/libhello.so
05-26 15:11:56.834 4747 4764 D ReLinker: Forcing a re-link of hello (null)...
05-26 15:11:56.835 4747 4764 D ReLinker: Looking for lib/x86/libhello.so in APK...
05-26 15:11:56.835 4747 4764 D ReLinker: Found lib/x86/libhello.so! Extracting...
05-26 15:11:56.854 4747 4764 D ReLinker: Beginning load of stdc++...
05-26 15:11:56.857 4747 4764 D ReLinker: stdc++ (null) was loaded normally!
05-26 15:11:56.857 4747 4764 D ReLinker: Beginning load of m...
05-26 15:11:56.887 4747 4764 D ReLinker: m (null) was loaded normally!
05-26 15:11:56.887 4747 4764 D ReLinker: Beginning load of c...
05-26 15:11:56.887 4747 4764 D ReLinker: c (null) was loaded normally!
05-26 15:11:56.887 4747 4764 D ReLinker: Beginning load of dl...
05-26 15:11:56.920 4747 4764 D ReLinker: Loading the library normally failed: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__cxa_finalize" referenced by "/system/lib/libdl.so"...
05-26 15:11:56.920 4747 4764 D ReLinker: at java.lang.Runtime.loadLibrary(Runtime.java:372)
05-26 15:11:56.920 4747 4764 D ReLinker: at java.lang.System.loadLibrary(System.java:1076)
05-26 15:11:56.920 4747 4764 D ReLinker: at com.getkeepsafe.relinker.SystemLibraryLoader.loadLibrary(SystemLibraryLoader.java:24)
05-26 15:11:56.920 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:163)
05-26 15:11:56.920 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:136)
05-26 15:11:56.920 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:92)
05-26 15:11:56.920 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:190)
05-26 15:11:56.920 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:136)
05-26 15:11:56.920 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:92)
05-26 15:11:56.920 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:190)
05-26 15:11:56.920 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance.access$000(ReLinkerInstance.java:31)
05-26 15:11:56.920 4747 4764 D ReLinker: at com.getkeepsafe.relinker.ReLinkerInstance$1.run(ReLinkerInstance.java:142)
05-26 15:11:56.920 4747 4764 D ReLinker: at java.lang.Thread.run(Thread.java:818)
05-26 15:11:56.920 4747 4764 D ReLinker: dl (null) was not loaded normally, re-linking...
05-26 15:11:56.920 4747 4764 D ReLinker: yuxiang getWorkaroundLibFile: /data/user/0/com.getkeepsafe.relinker.sample/app_lib/libdl.so
05-26 15:11:56.920 4747 4764 D ReLinker: Forcing a re-link of dl (null)...
05-26 15:11:56.921 4747 4764 D ReLinker: Looking for lib/x86/libdl.so in APK...
05-26 15:11:59.895 1263 1325 D hwcomposer: hw_composer sent 825 syncs in 60s
My app uses Android SDK 17.
In SystemLibraryLoader.java, the following line can't be compiled
if (Build.VERSION.SDK_INT >= 21 && Build.SUPPORTED_ABIS.length > 0)
due to SUPPORTED_ABIS not being found.
Is it safe to just uncomment this:
/* if (Build.VERSION.SDK_INT >= 21 && Build.SUPPORTED_ABIS.length > 0)
{
return Build.SUPPORTED_ABIS;
}
else */
or will this cause problems on some devices? Have tested on my own Android 6.0 device and it worked.
I'm sorry. My mistake.
I post another probject.
Your app is good!
The HashSet
-based loadedLibraries
field inReLinkerInstance
holding the names of already loaded library names is not thread-safe or guarded with a mutex. Relinker.loadLibrary()
can be called from multiple threads either by user code or by loading asynchronously via a LoadListener
, so it is a good idea to either use a lock on the Set
, or Collections.synchonizedSet()
or better, just pick something appropiate from java.util.concurrent
like a ConcurrentHashMap
wrapped with Collections.newSetFromMap()
Well I have checkout the #58 from @artyomd, but failing to load the native library from dataDirectory.
A/art: art/runtime/java_vm_ext.cc:475] JNI DETECTED ERROR IN APPLICATION: JNI RegisterNatives called with pending exception java.lang.ExceptionInInitializerError:
A/art: art/runtime/java_vm_ext.cc:475] at java.lang.String java.lang.Runtime.nativeLoad(java.lang.String, java.lang.ClassLoader, java.lang.String) (Runtime.java:-2)
A/art: art/runtime/java_vm_ext.cc:475] at java.lang.String java.lang.Runtime.doLoad(java.lang.String, java.lang.ClassLoader) (Runtime.java:1072)
A/art: art/runtime/java_vm_ext.cc:475] at void java.lang.Runtime.load0(java.lang.Class, java.lang.String) (Runtime.java:906)
A/art: art/runtime/java_vm_ext.cc:475] at void java.lang.System.load(java.lang.String) (System.java:1537)
A/art: art/runtime/java_vm_ext.cc:475] at void com.getkeepsafe.relinker.SystemLibraryLoader.loadPath(java.lang.String) (SystemLibraryLoader.java:29)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] at void com.getkeepsafe.relinker.ReLinkerInstance.loadInternal(android.content.Context, java.io.File) (ReLinkerInstance.java:250)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] at void com.getkeepsafe.relinker.ReLinkerInstance.access$100(com.getkeepsafe.relinker.ReLinkerInstance, android.content.Context, java.io.File) (ReLinkerInstance.java:31)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] at void com.getkeepsafe.relinker.ReLinkerInstance$2.run() (ReLinkerInstance.java:191)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] at void java.lang.Thread.run() (Thread.java:760)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475]
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] in call to RegisterNatives
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] from java.lang.String java.lang.Runtime.nativeLoad(java.lang.String, java.lang.ClassLoader, java.lang.String)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] "Thread-53" prio=5 tid=64 Runnable
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] | group="main" sCount=0 dsCount=0 obj=0x12ec9700 self=0xc5583f00
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] | sysTid=26890 nice=0 cgrp=default sched=0/0 handle=0xb297a920
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] | state=R schedstat=( 4651665 8239268 26 ) utm=0 stm=0 core=2 HZ=100
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] | stack=0xb2878000-0xb287a000 stackSize=1038KB
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] | held mutexes= "mutator lock"(shared held)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] native: #00 pc 00352411 /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+128)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] native: #01 pc 00332569 /system/lib/libart.so (_ZNK3art6Thread9DumpStackERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMap+308)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] native: #02 pc 0023a825 /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+848)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] native: #03 pc 0023ad47 /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+58)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] native: #04 pc 000cb09b /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+46)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] native: #05 pc 000cac87 /system/lib/libart.so (_ZN3art11ScopedCheck11CheckThreadEP7_JNIEnv+362)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] native: #06 pc 000c9c9f /system/lib/libart.so (_ZN3art11ScopedCheck22CheckPossibleHeapValueERNS_18ScopedObjectAccessEcNS_12JniValueTypeE+26)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] native: #07 pc 000c917b /system/lib/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE+802)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] native: #08 pc 000c678d /system/lib/libart.so (_ZN3art8CheckJNI15RegisterNativesEP7_JNIEnvP7_jclassPK15JNINativeMethodi+464)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] native: #09 pc 0000d90b /data/data/com.sample.preprod/app_libs/sample/libs/armeabi-v7a/libfb.so (_ZN8facebook3jni15CountableOnLoadEP7_JNIEnv+62)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] native: #10 pc 000153d9 /data/data/com.sample.preprod/app_libs/sample/libs/armeabi-v7a/libfb.so (_Z16initialize_fbjniv+8)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] native: #11 pc 000132b7 /data/data/com.sample.preprod/app_libs/sample/libs/armeabi-v7a/libfb.so (_ZN8facebook3jni10initializeEP7_JavaVMONSt6__ndk18functionIFvvEEE+90)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] native: #12 pc 00017829 /data/data/com.sample.preprod/app_libs/sample/libs/armeabi-v7a/libfb.so (JNI_OnLoad+32)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] native: #13 pc 0023c835 /system/lib/libart.so (_ZN3art9JavaVMExt17LoadNativeLibraryEP7_JNIEnvRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEP8_jobjectP8_jstringPS9_+1844)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] native: #14 pc 00003167 /system/lib/libopenjdkjvm.so (JVM_NativeLoad+178)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] native: #15 pc 00068c6d /system/framework/arm/boot.oat (Java_java_lang_Runtime_nativeLoad__Ljava_lang_String_2Ljava_lang_ClassLoader_2Ljava_lang_String_2+144)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] at java.lang.Runtime.nativeLoad(Native method)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] at java.lang.Runtime.doLoad(Runtime.java:1072)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] - locked <0x03d4240b> (a java.lang.Runtime)
2019-05-16 17:34:52.781 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] at java.lang.Runtime.load0(Runtime.java:906)
2019-05-16 17:34:52.782 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] - locked <0x03d4240b> (a java.lang.Runtime)
2019-05-16 17:34:52.782 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] at java.lang.System.load(System.java:1537)
2019-05-16 17:34:52.782 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] at com.getkeepsafe.relinker.SystemLibraryLoader.loadPath(SystemLibraryLoader.java:29)
2019-05-16 17:34:52.782 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] at com.getkeepsafe.relinker.ReLinkerInstance.loadInternal(ReLinkerInstance.java:250)
2019-05-16 17:34:52.782 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] at com.getkeepsafe.relinker.ReLinkerInstance.access$100(ReLinkerInstance.java:31)
2019-05-16 17:34:52.782 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] at com.getkeepsafe.relinker.ReLinkerInstance$2.run(ReLinkerInstance.java:191)
2019-05-16 17:34:52.782 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475] at java.lang.Thread.run(Thread.java:760)
2019-05-16 17:34:52.782 26411-26890/com.sample.preprod A/art: art/runtime/java_vm_ext.cc:475]
Any help is appreciated.
Hi,
I'm using ReLinker 1.2.2 with cocos2d 3.15.1.
Here is crash from real device:
Model: Lenovo K50-t5
Android API: 23
Android OS: 6.0
Exception java.lang.UnsatisfiedLinkError: dlopen failed: "/mnt/expand/96334dfa-6d50-4821-9b56-38dcc67f3a70/user/0/xxxxxxxxxxxxxx/app_lib/libcocos2djs.so" is 32-bit instead of 64-bit
java.lang.Runtime.load (Runtime.java:332)
java.lang.System.load (System.java:1069)
com.getkeepsafe.relinker.SystemLibraryLoader.loadPath (SystemLibraryLoader.java:29)
com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal (ReLinkerInstance.java:198)
com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary (ReLinkerInstance.java:136)
com.getkeepsafe.relinker.ReLinker.loadLibrary (ReLinker.java:70)
com.getkeepsafe.relinker.ReLinker.loadLibrary (ReLinker.java:51)
org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries (Cocos2dxActivity.java:247)
org.cocos2dx.lib.Cocos2dxActivity.onCreate (Cocos2dxActivity.java:265)
org.cocos2dx.javascript.AppActivity.onCreate (AppActivity.java:60)
android.app.Activity.performCreate (Activity.java:6583)
android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1114)
android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2531)
android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2666)
android.app.ActivityThread.-wrap11 (ActivityThread.java)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1493)
android.os.Handler.dispatchMessage (Handler.java:111)
android.os.Looper.loop (Looper.java:207)
android.app.ActivityThread.main (ActivityThread.java:5769)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:789)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:679)
I have a rooted Nexus 6P, I cannot call native function after I clicked "DELETE AND KILL" button. I found that directory '/data/app/com.getkeepsafe.relinker.sample-1/lib' is empty. Is it the reason why relinker cannot copy so back to app?
11-28 01:19:41.402 350-350/com.getkeepsafe.relinker.sample W/System: ClassLoader referenced unknown path: /data/app/com.getkeepsafe.relinker.sample-1/lib/arm
11-28 01:19:41.455 350-374/com.getkeepsafe.relinker.sample D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
11-28 01:19:41.554 350-374/com.getkeepsafe.relinker.sample I/Adreno: QUALCOMM build : 63c06b2, I8366cd0437
Build Date : 12/06/15
OpenGL ES Shader Compiler Version: XE031.05.13.02
Local Branch : mybranch17112971
Remote Branch : quic/LA.BF64.1.2.9_v2
Remote Branch : NONE
Reconstruct Branch : NOTHING
11-28 01:19:41.559 350-374/com.getkeepsafe.relinker.sample I/OpenGLRenderer: Initialized EGL, version 1.4
11-28 01:19:42.940 350-350/com.getkeepsafe.relinker.sample E/art: No implementation found for java.lang.String com.getkeepsafe.relinker.sample.Native.helloJni() (tried Java_com_getkeepsafe_relinker_sample_Native_helloJni and Java_com_getkeepsafe_relinker_sample_Native_helloJni__)
11-28 01:19:42.941 350-350/com.getkeepsafe.relinker.sample D/ReLinker: Beginning load of hellojni...
11-28 01:19:42.944 350-438/com.getkeepsafe.relinker.sample D/ReLinker: Loading the library normally failed: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.getkeepsafe.relinker.sample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.getkeepsafe.relinker.sample-1/lib/arm, /data/app/com.getkeepsafe.relinker.sample-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn't find "libhellojni.so"
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at com.getkeepsafe.relinker.SystemLibraryLoader.loadLibrary(SystemLibraryLoader.java:24)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:163)
at com.getkeepsafe.relinker.ReLinkerInstance.access$000(ReLinkerInstance.java:31)
at com.getkeepsafe.relinker.ReLinkerInstance$1.run(ReLinkerInstance.java:142)
at java.lang.Thread.run(Thread.java:818)
11-28 01:19:42.944 350-438/com.getkeepsafe.relinker.sample D/ReLinker: hellojni (1.0) was not loaded normally, re-linking...
11-28 01:19:42.945 350-438/com.getkeepsafe.relinker.sample D/ReLinker: Forcing a re-link of hellojni (1.0)...
11-28 01:19:42.946 350-438/com.getkeepsafe.relinker.sample D/ReLinker: Looking for lib/armeabi-v7a/libhellojni.so in APK...
11-28 01:19:42.946 350-438/com.getkeepsafe.relinker.sample D/ReLinker: Found lib/armeabi-v7a/libhellojni.so! Extracting...
11-28 01:19:42.959 350-438/com.getkeepsafe.relinker.sample D/ReLinker: Beginning load of hello...
11-28 01:19:42.960 350-438/com.getkeepsafe.relinker.sample D/ReLinker: Loading the library normally failed: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.getkeepsafe.relinker.sample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.getkeepsafe.relinker.sample-1/lib/arm, /data/app/com.getkeepsafe.relinker.sample-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn't find "libhello.so"
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at com.getkeepsafe.relinker.SystemLibraryLoader.loadLibrary(SystemLibraryLoader.java:24)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:163)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:136)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:92)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:189)
at com.getkeepsafe.relinker.ReLinkerInstance.access$000(ReLinkerInstance.java:31)
at com.getkeepsafe.relinker.ReLinkerInstance$1.run(ReLinkerInstance.java:142)
at java.lang.Thread.run(Thread.java:818)
11-28 01:19:42.960 350-438/com.getkeepsafe.relinker.sample D/ReLinker: hello (null) was not loaded normally, re-linking...
11-28 01:19:42.961 350-438/com.getkeepsafe.relinker.sample D/ReLinker: Forcing a re-link of hello (null)...
11-28 01:19:42.961 350-438/com.getkeepsafe.relinker.sample D/ReLinker: Looking for lib/armeabi-v7a/libhello.so in APK...
11-28 01:19:42.961 350-438/com.getkeepsafe.relinker.sample D/ReLinker: Found lib/armeabi-v7a/libhello.so! Extracting...
11-28 01:19:42.970 350-438/com.getkeepsafe.relinker.sample D/ReLinker: Beginning load of stdc++...
11-28 01:19:42.971 350-438/com.getkeepsafe.relinker.sample D/ReLinker: stdc++ (null) was loaded normally!
11-28 01:19:42.971 350-438/com.getkeepsafe.relinker.sample D/ReLinker: Beginning load of m...
11-28 01:19:42.971 350-438/com.getkeepsafe.relinker.sample D/ReLinker: m (null) was loaded normally!
11-28 01:19:42.971 350-438/com.getkeepsafe.relinker.sample D/ReLinker: Beginning load of c...
11-28 01:19:42.972 350-438/com.getkeepsafe.relinker.sample D/ReLinker: c (null) was loaded normally!
11-28 01:19:42.972 350-438/com.getkeepsafe.relinker.sample D/ReLinker: Beginning load of dl...
11-28 01:19:42.973 350-438/com.getkeepsafe.relinker.sample D/ReLinker: Loading the library normally failed: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__cxa_finalize" referenced by "/system/lib/libdl.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:372)
at java.lang.System.loadLibrary(System.java:1076)
at com.getkeepsafe.relinker.SystemLibraryLoader.loadLibrary(SystemLibraryLoader.java:24)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:163)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:136)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:92)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:189)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:136)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:92)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:189)
at com.getkeepsafe.relinker.ReLinkerInstance.access$000(ReLinkerInstance.java:31)
at com.getkeepsafe.relinker.ReLinkerInstance$1.run(ReLinkerInstance.java:142)
at java.lang.Thread.run(Thread.java:818)
11-28 01:19:42.973 350-438/com.getkeepsafe.relinker.sample D/ReLinker: dl (null) was not loaded normally, re-linking...
11-28 01:19:42.974 350-438/com.getkeepsafe.relinker.sample D/ReLinker: Forcing a re-link of dl (null)...
11-28 01:19:42.974 350-438/com.getkeepsafe.relinker.sample D/ReLinker: Looking for lib/armeabi/libdl.so in APK...```
We should be able to get significant code coverage quite easily, no reason not to.
As a bonus, we should enable Travis for the repo
Hey, guys. I have imported your library to my project. Recently I found the following crash log. It means that the library doesn't exist in apk for some unknown reason. But the Exception is thrown from a thread, thus I can't catch it myself. Could you protect app from crash in this special case.
Fatal Exception: com.getkeepsafe.relinker.MissingLibraryException: lib/armeabi-v7a/libcheckemu.so
at com.getkeepsafe.relinker.ApkLibraryInstaller.installLibrary(SourceFile:85)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(SourceFile:182)
at com.getkeepsafe.relinker.ReLinkerInstance.access$000(SourceFile:35)
at com.getkeepsafe.relinker.ReLinkerInstance$1.run(SourceFile:146)
at java.lang.Thread.run(Thread.java:841)
The ReLinker.java
javadoc says:
ReLinker is a small library to help alleviate
UnsatisfiedLinkError
exceptions thrown due to Android's inability to properly install / load native libraries for Android versions before API 21
But I can't find any official documentation on the Relinker blog [1][2] or in the readme saying the last Android version where Relinker is still required. Could you please add some documentation about this?
When I put the compile 'com.github.KeepSafe:ReLinker:1.1' in my build.gradle it says Failed to resolve.
Please help
In more recent versions of Android (since 23) we have extractNativeLibs option in the application element of the Android Manifest file. Is ReLinker still beneficial when setting this flag to false?
Also, what specific issues (maybe point to some issues in the Android issuetracker) are solved by this library?
We should allow users to kick off an asynchronous library load and be notified later via a callback. Something like the following is desired:
ReLinker.loadLibrary(context, "badlib", () -> { ... });
Contrary to my initial position for #3, the library should be able to handle version updates.
Preferably we should just adopt the standard versioning naming convention listed here http://www.faqs.org/docs/Linux-HOWTO/Program-Library-HOWTO.html#AEN46
Perhaps the interface should be
ReLinker.loadLibrary(context, "badlib", "1.0");
Additionally, it would be favorable if users can control the regeneration of library files, or be able to force library file re-loads. It might make sense to adopt a builder pattern for this, so we can do something like
ReLinker.force().loadLibrary(context, "badlib");
where force
will always unzip / re-link the library if the initial loadLibrary
call fails
Currently load library use "new ReLinkerInstance().loadLibrary()", so "ReLinkerInstance.loadedlibraries" will be invalid.
Can support ReLinkerInstance SingleInstance?
Hi first of all, thanks for releasing ReLinker!
Pleaes correct me if I am wrong here: I noticed there's no way to update the app once ReLinker has been applied.
In #71 it only checks whether the workaroundLib file exists but not if the Version matches, (e.g. after the App was updated and the native interface may have changed).
In snipped linked in your article the Chromium folks seem to have worked around this by unpacking the library once on every app start.
I got lot of this error in my app:
Exception java.lang.UnsatisfiedLinkError: Cannot load library: find_library[1201]: 1681 '[REDACTED_DOMAIN_NAME]' failed to load previously
java.lang.Runtime.load (Runtime.java:340)
java.lang.System.load (System.java:521)
com.getkeepsafe.relinker.SystemLibraryLoader.loadPath (SystemLibraryLoader.java:29)
com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal (ReLinkerInstance.java:198)
com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary (ReLinkerInstance.java:136)
com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary (ReLinkerInstance.java:92)
com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal (ReLinkerInstance.java:189)
com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary (ReLinkerInstance.java:136)
com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary (ReLinkerInstance.java:92)
From here: #15 I know that the developer solved it by compile the native libraries, but can we solve this in Relinker code?
Currently, it would appear as if library -> library dependency definitions within the ELF data are not handled properly. This can be explicitly fixed by simply loading the dependency library manually, however that requires maintenance and is not "nice."
Instead, it would be beneficial to catch UnsatisfiedLinkError
and subsequently check to see if the library defines any library -> library dependencies. If it does, the library should try to load those dependencies, then re-load the dependent library.
Or it can be tackled the other way by storing a list of already loaded libraries and checking for the dependency libraries before attempting to load the dependent library.
I used ReLinker.LoadListener to loadLibrary, but if I call native method immediately, it would be fail.
First of all,Thank you for share such a great project!! We had this problem for many yeas!
I run the Sample project. After delete the so file it seems that after parseNeededDependencies it try to load libdl.so.
04-29 16:32:21.888 22887-23167/com.getkeepsafe.relinker.sample E/AndroidRuntime: FATAL EXCEPTION: Thread-4944
Process: com.getkeepsafe.relinker.sample, PID: 22887
com.getkeepsafe.relinker.MissingLibraryException: lib/armeabi/libdl.so
at com.getkeepsafe.relinker.ApkLibraryInstaller.installLibrary(ApkLibraryInstaller.java:85)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:182)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:140)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:96)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:191)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:140)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:96)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:191)
at com.getkeepsafe.relinker.ReLinkerInstance.access$000(ReLinkerInstance.java:35)
at com.getkeepsafe.relinker.ReLinkerInstance$1.run(ReLinkerInstance.java:146)
at java.lang.Thread.run(Thread.java:818)```
I want to use a new version of the system library.
So I wrote the following code.
ReLinker.loadLibrary(context, "abcedf", "1.0.10");
But I could not get good results.
I found the cause by reading the source code.
private void loadLibraryInternal(final Context context,
final String library,
final String version) {
if (loadedLibraries.contains(library) && !force) {
log("%s already loaded previously!", library);
return;
}
try {
libraryLoader.loadLibrary(library);
loadedLibraries.add(library);
log("%s (%s) was loaded normally!", library, version);
return;
} catch (final UnsatisfiedLinkError e) {
// :-(
log("Loading the library normally failed: %s", Log.getStackTraceString(e));
}
If a system library exists, it will be loaded without version checking.
Could you tell me how to check the version even if there is a system library?
Thanks in advance.
Hey,
Here's the stack trace of my log with Relinker. The .so file seems to load normally but fails to call any native method that's being implemented inside the .so file.
Note : I am using your library listener with jnr-ffi for Android devices.
Stacktrace from Relinker
04-21 11:50:59.032 4455-4455/com.example.expertonetechnologies.jnrsample E/Native Directory: /data/app/com.example.expertonetechnologies.jnrsample-2/lib/arm
04-21 11:50:59.032 4455-4455/com.example.expertonetechnologies.jnrsample E/Files: Size: 2
04-21 11:50:59.033 4455-4455/com.example.expertonetechnologies.jnrsample E/CPU ARCH TYPE: armeabi
04-21 11:50:59.037 4455-4455/com.example.expertonetechnologies.jnrsample E/Relink Logged: Beginning load of ffi_demo_old...
04-21 11:50:59.039 4455-4503/com.example.expertonetechnologies.jnrsample E/Relink Logged: ffi_demo_old (null) was loaded normally!
04-21 11:50:59.039 4455-4503/com.example.expertonetechnologies.jnrsample E/FFI DEMO: LIBRARY LOADED SUCCESSFULLY
Just curious on what does that null
mean in ffi_demo_old (null)
Here's my Android Java Code.
ReLinker.log(new ReLinker.Logger() {
@Override
public void log(String message) {
Log.e("Relink Logged",message);
}
}).loadLibrary(MainActivity.this, "ffi_demo_old", new ReLinker.LoadListener() {
@Override
public void success() {
//Calling jnr-ffi library to load the interface class thereby calling the native method
RustLib rustLib=LibraryLoader.create(RustLib.class).load("ffi_demo_old");
rustLib.double_input(10);
Log.e("FFI DEMO","LIBRARY LOADED SUCCESSFULLY");
}
@Override
public void failure(Throwable t) {
Log.e("FFI DEMO","LIBRARY LOADED FAILED");
t.printStackTrace();
}
});
This one now throws me an error and here's the stacktrace of the same for your reference. Gives me an ambiguous output in the logger.
04-21 11:55:08.489 7360-7360/com.example.expertonetechnologies.jnrsample E/Native Directory: /data/app/com.example.expertonetechnologies.jnrsample-1/lib/arm
04-21 11:55:08.489 7360-7360/com.example.expertonetechnologies.jnrsample E/Files: Size: 2
04-21 11:55:08.489 7360-7360/com.example.expertonetechnologies.jnrsample E/CPU ARCH TYPE: armeabi
04-21 11:55:08.493 7360-7360/com.example.expertonetechnologies.jnrsample E/Relink Logged: Beginning load of ffi_demo_old...
04-21 11:55:08.494 7360-7391/com.example.expertonetechnologies.jnrsample E/Relink Logged: ffi_demo_old (null) was loaded normally!
04-21 11:55:08.506 7360-7392/com.example.expertonetechnologies.jnrsample D/AppTracker: App Event: start
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample E/FFI DEMO: LIBRARY LOADED FAILED
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: java.lang.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.Provider
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at jnr.ffi.provider.InvalidProvider$1.loadLibrary(InvalidProvider.java:30)
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at jnr.ffi.LibraryLoader.load(LibraryLoader.java:269)
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at jnr.ffi.LibraryLoader.load(LibraryLoader.java:248)
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.example.expertonetechnologies.jnrsample.MainActivity$1.success(MainActivity.java:50)
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.getkeepsafe.relinker.ReLinkerInstance$1.run(ReLinkerInstance.java:143)
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at java.lang.Thread.run(Thread.java:761)
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: Caused by: java.lang.ExceptionInInitializerError
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:49)
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at jnr.ffi.provider.jffi.Provider.<init>(Provider.java:29)
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at java.lang.Class.newInstance(Native Method)
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68)
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.<clinit>(FFIProvider.java:57)
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.access$000(FFIProvider.java:56)
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35)
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at jnr.ffi.LibraryLoader.create(LibraryLoader.java:52)
04-21 11:55:08.521 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: ... 3 more
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: Caused by: java.lang.IllegalStateException: Can't overwrite cause with java.lang.UnsatisfiedLinkError
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.Type$Builtin.lookupTypeInfo(Type.java:252)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.Type$Builtin.getTypeInfo(Type.java:237)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.Type.resolveSize(Type.java:155)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.Type.size(Type.java:138)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at jnr.ffi.provider.jffi.NativeRuntime$TypeDelegate.size(NativeRuntime.java:178)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at jnr.ffi.provider.AbstractRuntime.<init>(AbstractRuntime.java:48)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:57)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:41)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.<clinit>(NativeRuntime.java:53)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: ... 11 more
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: Caused by: java.lang.UnsatisfiedLinkError
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.Foreign.newLoadError(Foreign.java:72)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.Foreign.access$300(Foreign.java:42)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.Foreign$InValidInstanceHolder.getForeign(Foreign.java:98)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.Foreign.getInstance(Foreign.java:103)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.Type$Builtin.lookupTypeInfo(Type.java:242)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: ... 19 more
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: Caused by: java.lang.UnsatisfiedLinkError
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.Init.newLoadError(Init.java:132)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.Init.load(Init.java:89)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:49)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.Foreign$InstanceHolder.<clinit>(Foreign.java:45)
04-21 11:55:08.522 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: ... 21 more
04-21 11:55:08.523 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: Caused by: java.lang.RuntimeException: cannot determine CPU
04-21 11:55:08.523 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.internal.StubLoader.determineCPU(StubLoader.java:189)
04-21 11:55:08.523 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.internal.StubLoader.getCPU(StubLoader.java:193)
04-21 11:55:08.523 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.internal.StubLoader.getPlatformName(StubLoader.java:221)
04-21 11:55:08.523 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.internal.StubLoader.loadFromBootPath(StubLoader.java:306)
04-21 11:55:08.523 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.internal.StubLoader.load(StubLoader.java:246)
04-21 11:55:08.523 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.internal.StubLoader.<clinit>(StubLoader.java:431)
04-21 11:55:08.523 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at java.lang.Class.classForName(Native Method)
04-21 11:55:08.523 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at java.lang.Class.forName(Class.java:400)
04-21 11:55:08.523 7360-7391/com.example.expertonetechnologies.jnrsample W/System.err: at com.kenai.jffi.Init.load(Init.java:68)
Sorry for such a long post . Thanks for your patience in taking time to read this one 😄
Awaiting your response over this issue.
I am facing this problem Multiple dex files define Lcom/getkeepsafe/relinker/SystemLibraryLoader;
Here is my build.gradle:moduleapp
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
android {
compileSdkVersion 26
buildToolsVersion '26.0.3'
defaultConfig {
applicationId 'com.taxiapp.passenger'
minSdkVersion 17
targetSdkVersion 26
versionCode 13
versionName '1.0.3'
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
dexOptions {
javaMaxHeapSize '4g'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
allprojects {
repositories {
mavenCentral()
}
}
/* IMPORTANT :
Be careful when update dependencies, different version library may caused error /
dependencies {
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.+'
}
dependencies {
compile fileTree(include: ['.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.google.code.findbugs'
})
compile('com.mikepenz:fastadapter:2.0.0@aar') {
transitive = true
}
compile 'com.afollestad.material-dialogs:core:0.9.0.0'
compile 'com.mikepenz:iconics-core:2.8.1@aar'
compile 'com.mikepenz:fontawesome-typeface:4.6.0.2@aar'
compile('cn.trinea.android.view.autoscrollviewpager:android-auto-scroll-view-pager:1.1.2') {
exclude module: 'support-v4'
}
// compile('pl.droidsonroids.relinker:1.2.2'){
// exclude module: 'pl.droidsonroids.relinker:1.2.2'
// }
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.android.support:support-vector-drawable:26.1.0'
compile 'com.android.support:multidex:1.0.3'
compile 'com.google.guava:guava:19.0'
compile 'com.dmitrymalkovich.android:material-design-dimens:1.4'
compile 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
compile 'com.ogaclejapan.smarttablayout:utils-v4:1.6.1@aar'
compile 'com.jakewharton:butterknife:8.4.0'
compile 'me.relex:circleindicator:1.2.2@aar'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'com.google.firebase:firebase-core:12.0.1'
compile 'com.google.firebase:firebase-messaging:12.0.1'
compile 'com.mobsandgeeks:android-saripaar:2.0.3'
compile 'com.google.android.gms:play-services:12.0.1'
compile 'org.greenrobot:eventbus:3.1.0'
compile 'com.makeramen:roundedimageview:2.2.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.github.siyamed:android-shape-imageview:0.9.3'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.balysv:material-ripple:1.0.2'
}
dependencies {
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
apply plugin: 'com.google.gms.google-services'
And here is my build.gradle:projectmodule
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'io.realm:realm-gradle-plugin:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
// maven {
// url 'https://maven.google.com/'
// name 'Google'
// }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Please advice what i can do to solve this proplem
https://jitpack.io/#KeepSafe/ReLinker reports that no release has been tagged:
Repository not found or requires authentication
No releases found. Use the short commit id or -SNAPSHOT
Attempting to include the library using the provided dependency line:
compile 'com.github.KeepSafe:ReLinker:1.0'
Reports that it can not be found.
If ReLinker is published to Maven Central then other libraries published there may depend on it.
I really have no idea about that. No one class is used, so why they are there?
TLDR : ReLinker is looking in /lib folder of my android project and not also in the /jni folder of my aar file (which contains some so files) which result with a java.lang.UnsatisfiedLinkError
Create the aar file including so files
I created an aar library which contains a few shared-objects. Those so files are stored in the /jni folder according to Android documentation. So the compilation of the aar library is not a problem.
Import aar in Android project
Then when I import the aar file in an android project, I use relinker.recursive() to get my so file. But it seems that relinker is looking only in the /lib folder of the android project, and not also in the /jni folder of the aar library.
V/ReLinkerInstance: [LibraryLoadingTask.log()-32]: Loading the library normally failed: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.colorix.spike.nano-KLziZmxzMy8HpQoBCkOsAA==/base.apk"],nativeLibraryDirectories=[/data/app/com.colorix.spike.nano-KLziZmxzMy8HpQoBCkOsAA==/lib/x86, /system/lib]]] couldn't find "libnanolcms.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1012)
at java.lang.System.loadLibrary(System.java:1669)
at com.getkeepsafe.relinker.SystemLibraryLoader.loadLibrary(SystemLibraryLoader.java:24)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:163)
at com.getkeepsafe.relinker.ReLinkerInstance.access$000(ReLinkerInstance.java:31)
at com.getkeepsafe.relinker.ReLinkerInstance$1.run(ReLinkerInstance.java:142)
at java.lang.Thread.run(Thread.java:764)
[LibraryLoadingTask.log()-32]: nanolcms (null) was not loaded normally, re-linking...
V/ReLinkerInstance: [LibraryLoadingTask.log()-32]: Looking for lib/x86/libnanolcms.so in APK /data/app/com.colorix.spike.nano-KLziZmxzMy8HpQoBCkOsAA==/base.apk...
V/ReLinkerInstance: [LibraryLoadingTask.log()-32]: Looking for lib/armeabi-v7a/libnanolcms.so in APK /data/app/com.colorix.spike.nano-KLziZmxzMy8HpQoBCkOsAA==/base.apk...
V/ReLinkerInstance: [LibraryLoadingTask.log()-32]: Looking for lib/armeabi/libnanolcms.so in APK /data/app/com.colorix.spike.nano-KLziZmxzMy8HpQoBCkOsAA==/base.apk...
V/ReLinkerInstance: [LibraryLoadingTask.log()-32]: Looking for lib/x86/libnanolcms.so in APK /data/app/com.colorix.spike.nano-KLziZmxzMy8HpQoBCkOsAA==/base.apk...
V/ReLinkerInstance: [LibraryLoadingTask.log()-32]: Looking for lib/armeabi-v7a/libnanolcms.so in APK /data/app/com.colorix.spike.nano-KLziZmxzMy8HpQoBCkOsAA==/base.apk...
V/ReLinkerInstance: [LibraryLoadingTask.log()-32]: Looking for lib/armeabi/libnanolcms.so in APK /data/app/com.colorix.spike.nano-KLziZmxzMy8HpQoBCkOsAA==/base.apk...
V/ReLinkerInstance: [LibraryLoadingTask.log()-32]: Looking for lib/x86/libnanolcms.so in APK /data/app/com.colorix.spike.nano-KLziZmxzMy8HpQoBCkOsAA==/base.apk...
V/ReLinkerInstance: [LibraryLoadingTask.log()-32]: Looking for lib/armeabi-v7a/libnanolcms.so in APK /data/app/com.colorix.spike.nano-KLziZmxzMy8HpQoBCkOsAA==/base.apk...
V/ReLinkerInstance: [LibraryLoadingTask.log()-32]: Looking for lib/armeabi/libnanolcms.so in APK /data/app/com.colorix.spike.nano-KLziZmxzMy8HpQoBCkOsAA==/base.apk...
V/ReLinkerInstance: [LibraryLoadingTask.log()-32]: Looking for lib/x86/libnanolcms.so in APK /data/app/com.colorix.spike.nano-KLziZmxzMy8HpQoBCkOsAA==/base.apk...
V/ReLinkerInstance: [LibraryLoadingTask.log()-32]: Looking for lib/armeabi-v7a/libnanolcms.so in APK /data/app/com.colorix.spike.nano-KLziZmxzMy8HpQoBCkOsAA==/base.apk...
[LibraryLoadingTask.log()-32]: Looking for lib/armeabi/libnanolcms.so in APK /data/app/com.colorix.spike.nano-KLziZmxzMy8HpQoBCkOsAA==/base.apk...
V/ReLinkerInstance: [LibraryLoadingTask.log()-32]: Looking for lib/x86/libnanolcms.so in APK /data/app/com.colorix.spike.nano-KLziZmxzMy8HpQoBCkOsAA==/base.apk...
V/ReLinkerInstance: [LibraryLoadingTask.log()-32]: Looking for lib/armeabi-v7a/libnanolcms.so in APK /data/app/com.colorix.spike.nano-KLziZmxzMy8HpQoBCkOsAA==/base.apk...
V/ReLinkerInstance: [LibraryLoadingTask.log()-32]: Looking for lib/armeabi/libnanolcms.so in APK /data/app/com.colorix.spike.nano-KLziZmxzMy8HpQoBCkOsAA==/base.apk...
W/orix.spike.nan: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
W/orix.spike.nan: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
I/orix.spike.nan: Background concurrent copying GC freed 21210(7MB) AllocSpace objects, 0(0B) LOS objects, 49% free, 1727KB/3MB, paused 10.482ms total 300.249ms
W/orix.spike.nan: Accessing hidden method Landroid/widget/TextView;->getTextDirectionHeuristic()Landroid/text/TextDirectionHeuristic; (light greylist, linking)
I/MainActivity: onResume()
nanoUsbDevice = com.colorix.cxcolorcatch.CXColorcatchManager@e92abb4
V/MainActivity: [CXColorcatchManager.getInstance()-59]: getInstance
I/MainActivity: nano = null
D/OpenGLRenderer: Skia GL Pipeline
V/ReLinkerInstance: [LibraryLoadingTask.failure()-54]: Unable to load nanolcms library
Of course if I copy/paste those .so files in the android project those library will be loaded using ReLinker. But that's not what I try to achieve.
For more information about my problem, I posted on Stackoverflow
E AndroidRuntime: java.lang.RuntimeException: Unable to bind to service io.rong.imlib.ipc.RongService@495a5e1 with Intent { cmp=com.xiniu.manmoli/io.rong.imlib.ipc.RongService (has extras) }: io.rong.imlib.relinker.MissingLibraryException: libdl.so
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at android.app.ActivityThread.handleBindService(ActivityThread.java:3304)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at android.app.ActivityThread.-wrap3(ActivityThread.java)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1638)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at android.os.Looper.loop(Looper.java:165)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6375)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: Caused by: io.rong.imlib.relinker.MissingLibraryException: libdl.so
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at sd.b.a(SourceFile:38)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at sd.f.d(SourceFile:15)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at sd.f.a(SourceFile:8)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at sd.f.a(SourceFile:4)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at sd.f.d(SourceFile:21)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at sd.f.a(SourceFile:8)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at sd.f.a(SourceFile:4)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at io.rong.imlib.NativeObject.(SourceFile:3)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at gd.Yd.a(SourceFile:19)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at gd.hc.(SourceFile:4)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at io.rong.imlib.ipc.RongService.onBind(SourceFile:4)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: at android.app.ActivityThread.handleBindService(ActivityThread.java:3290)
08-07 01:58:34.841 7763 7763 E AndroidRuntime: ... 8 more
Right now, if a library project uses ReLinker, it needs to tell its users to add the jitpack repository, which is inconvenient.
Publishing to jcenter would solve the issue as it's the standard repository for Android projects.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.