SnappyDB icon indicating copy to clipboard operation
SnappyDB copied to clipboard

UnsatisfiedLinkError

Open jblernout opened this issue 11 years ago • 16 comments

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.(DBImpl.java:38) at com.snappydb.DBFactory.open(DBFactory.java:40) at com.snappydb.DBFactory.open(DBFactory.java:65) at com.snappydb.DBFactory.open(DBFactory.java:77) at com.jbl.android.spotimote.Lookup.ItemsCache.(ItemsCache.java:31) at com.jbl.android.spotimote.SpotimoteService.bootService(SpotimoteService.java:319) at com.jbl.android.spotimote.SpotimoteService.onStartCommand(SpotimoteService.java:230) at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2860) at android.app.ActivityThread.access$2200(ActivityThread.java:161) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1362) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:157) at android.app.ActivityThread.main(ActivityThread.java:5356) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081) at dalvik.system.NativeStart.main(Native Method)

jblernout avatar Sep 23 '14 08:09 jblernout

Related to #19 if not the same

mradzinski avatar Oct 05 '14 22:10 mradzinski

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.

jblernout avatar Oct 06 '14 08:10 jblernout

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)
            ...

iKiKi avatar Jan 29 '15 09:01 iKiKi

@nhachicha ~> 0.5.0 release provide :

  • armeabi-v7a
  • armeabi
  • x86
  • mips

Following libs are missing :

  • arm64-v8a
  • x86_64
  • mips64

iKiKi avatar Jan 29 '15 14:01 iKiKi

@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);
                  ^

iKiKi avatar Jan 29 '15 15:01 iKiKi

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.(DBImpl.java:40)

edcheezburger avatar Feb 02 '15 20:02 edcheezburger

Is there anyone trying to fix this?

pueding avatar Apr 14 '15 07:04 pueding

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

nhachicha avatar Apr 14 '15 13:04 nhachicha

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,

nhachicha avatar Apr 15 '15 00:04 nhachicha

I just faced this issue on an XPeria T (related closely to the M). Uninstalling and installing seems to have fixed it.

thedumbtechguy avatar Sep 18 '15 18:09 thedumbtechguy

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.

van11 avatar Nov 05 '15 13:11 van11

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'

viadanna avatar Nov 11 '15 19:11 viadanna

+1. Doesn't work with Play Services 8.3.0 and GMS 1.5.0-beta2 :(

Any idea why?

adrien-aubel avatar Nov 16 '15 20:11 adrien-aubel

Created https://github.com/nhachicha/SnappyDB/issues/68

adrien-aubel avatar Nov 16 '15 20:11 adrien-aubel

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)
        ......

wondertwo avatar Dec 26 '19 03:12 wondertwo

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,

it works for my error

wondertwo avatar Dec 26 '19 04:12 wondertwo