UnsatisfiedLinkError
Here is the error I obtain on some devices like Galaxy S4, note 2, xperia M...
java.lang.UnsatisfiedLinkError: Couldn't load snappydb-native from loader dalvik.system.PathClassLoader[dexPath=/data/app/com.jbl.android.spotimote-4.apk,libraryPath=/data/app-lib/com.jbl.android.spotimote-4]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at com.snappydb.internal.DBImpl.
Related to #19 if not the same
Not the same issue. The libs are in the APK, we checked with nhachicha.
It works fine on most devices but from time to time on some devices, this error appears. It's really not frequent, like once for 10.000 users.
Same runtime error when I try to run my Android app on HTC Nexus 9 (API 21). Nexus 9 has a NVIDIA Tegra K1 64 bits, 2,3 GHz. @nhachicha : SnappyDB does not provide any 64 bits JNI library, is there any reason for that ?
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.my.app-1/base.apk"],nativeLibraryDirectories=[/data/app/com.my.app-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libsnappydb-native.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:989)
at com.snappydb.internal.DBImpl.<clinit>(DBImpl.java:38)
at com.snappydb.DBFactory.open(DBFactory.java:40)
at com.snappydb.DBFactory.open(DBFactory.java:65)
...
@nhachicha ~> 0.5.0 release provide :
- armeabi-v7a
- armeabi
- x86
- mips
Following libs are missing :
- arm64-v8a
- x86_64
- mips64
@nhachicha : It seems that you use the 32bits NDK to build your library. I tried to build SnappyDB using the 32/64bits NDK but I encounter the following error:
[arm64-v8a] Compile++ : snappydb-native <= port_android.cc
jni/./port/port_android.cc: In function 'int fdatasync(int)':
jni/./port/port_android.cc:23:18: error: 'fsync' was not declared in this scope
return fsync(fd);
^
Getting the same issue on an HTC One X, which I don't believe is 64 bit:
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load snappydb-native: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:365)
at java.lang.System.loadLibrary(System.java:535)
at com.snappydb.internal.DBImpl.
Is there anyone trying to fix this?
Hi 32 bits native libs should run without a problem on 64bits
did you use the AAR to import the lib?
what's the output of jar -tf your.apk?
can you share pls code/apk so I can investigate
Cheers
Hi,
I pushed a snapshot AAR including 64-bit ABIs can you please check if it works. I'll push to maven central ASAP.
repositories {
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
dependencies {
compile 'com.snappydb:snappydb-lib:0.5.1-SNAPSHOT'
compile 'com.esotericsoftware.kryo:kryo:2.24.0'
}
Cheers,
I just faced this issue on an XPeria T (related closely to the M). Uninstalling and installing seems to have fixed it.
Hi, we are still facing issues, stacktrace:
Fatal Exception: java.lang.UnsatisfiedLinkError: Couldn't load snappydb-native from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/X-2.apk", zip file "/data/data/X/code_cache/secondary-dexes/X-2.apk.classes2.zip"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:355)
at java.lang.System.loadLibrary(System.java:525)
at com.snappydb.internal.DBImpl.<clinit>(DBImpl.java:40)
at com.snappydb.DBFactory.open(DBFactory.java:40)
at com.snappydb.DBFactory.open(DBFactory.java:65)
at com.snappydb.DBFactory.open(DBFactory.java:77)
snappy db version: com.snappydb:snappydb-lib:0.5.2
If it is important, we have multidex enabled in our project.
Any tips how to avoid this would be helpful :)
Thanks.
Hello guys,
I started seeing this issue today after updating play-services to 8.3.0. Downgrading back to 8.1.0 works for now.
classpath 'com.google.gms:google-services:1.4.0-beta3'
compile 'com.google.android.gms:play-services:8.1.0'
+1. Doesn't work with Play Services 8.3.0 and GMS 1.5.0-beta2 :(
Any idea why?
Created https://github.com/nhachicha/SnappyDB/issues/68
i have the same error on my device OnePlus 7 Pro, error like
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[...] couldn't find "libsnappydb-native.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1012)
at java.lang.System.loadLibrary(System.java:1669)
at com.snappydb.internal.DBImpl.<clinit>(DBImpl.java:38)
at com.snappydb.DBFactory.open(DBFactory.java:40)
at com.snappydb.DBFactory.open(DBFactory.java:65)
......
Hi, I pushed a snapshot
AARincluding64-bit ABIscan you please check if it works. I'll push to maven central ASAP.repositories { maven { url "https://oss.sonatype.org/content/repositories/snapshots" } } dependencies { compile 'com.snappydb:snappydb-lib:0.5.1-SNAPSHOT' compile 'com.esotericsoftware.kryo:kryo:2.24.0' }Cheers,
it works for my error