Xamarin.Forms sqlite-net-pcl 1.2.1 crash Android 6 Emulator

Hi all, I'm new in Xamarin.Forms and I'm developing a simple app that accessed to sqlite database. I read the problem with Andorid N and the new restriction of applications using non-public APIs such as SQLite, so I downloaded the last release of sqlite-net-pcl.

In the Xamarin.Android project I set "target android version" to 23 and I imported the following libraries with NuGet:

  • sqlite-net-pcl 1.2.1
  • SQLitePCLRaw.bundle_green
  • SQLitePCLRaw.core
  • SQLitePCLRaw.lib.esqlite3.android

When the app is launched on emulator (Android 6, Api 23) it crashes on start.
Any possible solution?

Thanks,
Marco.

Answers

  • NamyslawSzymaniukNamyslawSzymaniuk USMember ✭✭✭

    I've moved from:

    Detected problems with app native libraries (please consult log for details):
    libmonosgen-64bit-2.0.so: unauthorized access to "/system/lib64/libsqlite.so"

    at SQLite.Net PCL 3.1.1, against Android 6.0 and higher.

    Currently, against SQLite-net PCL 1.2.1 I have no issue - as well at Android 6.0 emulator, as well as my private Android 7.1 real device.

    Maybe some stacktrace could be useful here...

  • Thanks for the quick answer, this is the stacktrace:

    Time Device Name Type PID Tag Message 12-06 10:26:56.608 Android-6 Error 1519 TaskPersister File error accessing recents directory (directory doesn't exist?). 12-06 10:26:53.881 Android-6 Error 2885 AndroidRuntime at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5342) 12-06 10:26:53.881 Android-6 Error 2885 AndroidRuntime at android.app.ActivityThread.installProvider(ActivityThread.java:5811) 12-06 10:26:53.881 Android-6 Error 2885 AndroidRuntime at android.app.ActivityThread.-wrap2(ActivityThread.java) 12-06 10:26:53.881 Android-6 Error 2885 AndroidRuntime at java.lang.reflect.Method.invoke(Native Method) 12-06 10:26:53.881 Android-6 Error 2885 AndroidRuntime at android.os.Handler.dispatchMessage(Handler.java:102) 12-06 10:26:53.881 Android-6 Error 2885 AndroidRuntime at java.lang.System.loadLibrary(System.java:1530) 12-06 10:26:53.881 Android-6 Error 2885 AndroidRuntime at android.app.ActivityThread.main(ActivityThread.java:6077) 12-06 10:26:53.881 Android-6 Error 2885 AndroidRuntime at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:42) 12-06 10:26:53.881 Android-6 Error 2885 AndroidRuntime java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/AnagraficaMultiPaltform.Droid-1/base.apk"],nativeLibraryDirectories=[/data/app/AnagraficaMultiPaltform.Droid-1/lib/x86_64, /system/fake-libs64, /data/app/AnagraficaMultiPaltform.Droid-1/base.apk!/lib/x86_64, /system/lib64, /vendor/lib64]]] couldn't find "libmonodroid.so" 12-06 10:26:53.881 Android-6 Error 2885 AndroidRuntime at java.lang.Runtime.loadLibrary0(Runtime.java:972) 12-06 10:26:53.881 Android-6 Error 2885 AndroidRuntime at android.app.ActivityThread.installContentProviders(ActivityThread.java:5403) 12-06 10:26:53.881 Android-6 Error 2885 AndroidRuntime at android.os.Looper.loop(Looper.java:154) 12-06 10:26:53.881 Android-6 Error 2885 AndroidRuntime FATAL EXCEPTION: main 12-06 10:26:53.881 Android-6 Error 2885 AndroidRuntime Process: AnagraficaMultiPaltform.Droid, PID: 2885 12-06 10:26:53.881 Android-6 Error 2885 AndroidRuntime at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1528) 12-06 10:26:53.881 Android-6 Error 2885 AndroidRuntime at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 12-06 10:26:53.881 Android-6 Error 2885 AndroidRuntime at mono.MonoPackageManager.LoadApplication(MonoPackageManager.java:34)

  • JasonTomsJasonToms USMember ✭✭
    edited December 2016

    I solved this problem by enabling x86_64 builds in advanced properties. The problem seemed to be that those sqlite libraries added a lib64 folder to the apk, but if your app was not building for 64bit then the libmonodroid.so library would be missing from the lib64 folder.

Sign In or Register to comment.