sevar83 / android-spatialite

Spatialite database JNI wrapper for Android
101 stars 48 forks source link

dlopen failed: library "libandroid_runtime.so" not found in Android 7 #1

Closed mdumrauf closed 7 years ago

mdumrauf commented 7 years ago

I am getting this runtime error only on Android Nougat 7.0. Is this a known issue?

Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: library "libandroid_runtime.so" not found
       at java.lang.Runtime.loadLibrary0(Runtime.java:977)
       at java.lang.System.loadLibrary(System.java:1567)
       at org.spatialite.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:151)
       at org.spatialite.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:138)
       at com.foo.bar.db.SpatialiteDao.<init>(SpatialiteDao.java:117)
       at com.foo.bar.db.SpatialiteDao.getInstance(SpatialiteDao.java:327)
       at com.foo.bar.fragments.s0.FragmentMC2.onCreateView(FragmentMC2.java:91)
       at android.support.v4.app.Fragment.performCreateView(Fragment.java:2192)
       at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1299)
       at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
       at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
       at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:758)
       at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2363)
       at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2149)
       at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2103)
       at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2013)
       at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:710)
       at android.os.Handler.handleCallback(Handler.java:751)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6780)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
sevar83 commented 7 years ago

Yes, It's fixed in 2.0.0-RC0. This is a well known problem described here: https://developer.android.com/about/versions/nougat/android-7.0-changes.html#ndk

You target API24 or higher, right? Could you please try with the new version 2.0.0-RC0?

compile "com.github.sevar83:android-spatialite:2.0.0-RC0"

It supports Android N together with a lot of improvements. There are some breaking changes but just repackaging of classes and interfaces. Check out Migration to 2.0

Let me know if you have a problem.

mdumrauf commented 7 years ago

I am targeting 19 or higher. So when I run it on any api lever less than 24 it works OK. I will try 2.0.0-RC out. Thanks!

sevar83 commented 7 years ago

Hi again, did you encounter any problems?

mdumrauf commented 7 years ago

Hey @sevar83, I haven't tried it yet. But will do tomorrow and let you know.

mdumrauf commented 7 years ago

@sevar83 working great. Thanks!