Android-'SQLite.SQLiteConnection'的类型初始值设定项引发了异常.--->System.DllNotFoundException:e_sqlite3 [英] Android - The type initializer for 'SQLite.SQLiteConnection' threw an exception. ---> System.DllNotFoundException: e_sqlite3

查看:222
本文介绍了Android-'SQLite.SQLiteConnection'的类型初始值设定项引发了异常.--->System.DllNotFoundException:e_sqlite3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的Xamarin Android项目中,我们正在尝试从sqlite-net转换为正式的sqlite-net-pcl软件包.

On our Xamarin Android project we are trying to switch from sqlite-net to official sqlite-net-pcl package.

但是在创建新的SQLiteConnection时进行此切换之后,出现以下异常:

However after this switch when creating a new SQLiteConnection I am getting following exception:

"SQLite.SQLiteConnection"的类型初始值设定项引发了异常.---> System.DllNotFoundException:e_sqlite3

The type initializer for 'SQLite.SQLiteConnection' threw an exception. ---> System.DllNotFoundException: e_sqlite3

完全例外:

Xamarin由:android.runtime.JavaProxyThrowable引起:System.TypeInitializationException:的类型初始值设定项'SQLite.SQLiteConnection'引发了异常.--->System.DllNotFoundException:e_sqlite3 at(包装本地管理)SQLitePCL.SQLite3Provider_e_sqlite3 + NativeMethods:sqlite3_libversion_number() 在SQLitePCL.SQLite3Provider_e_sqlite3.SQLitePCL.ISQLite3Provider.sqlite3_libversion_number()[0x00000]在:0处SQLitePCL.raw.SetProvider(SQLitePCL.ISQLite3Provider imp)[0x00000]在< 4472a4c16754425197d915f39ebd937e>:0处SQLitePCL.Batteries_V2.Init()[0x0000d]在< 1125db7e18f0475797b2764ec6653cf1>:0在SQLite.SQLiteConnection..cctor()[0x00000]在/Users/fak/Dropbox/Projects/sqlite-net/src/SQLite.cs:171 ---结束内部异常堆栈跟踪---在mono.android.view.View_OnClickListenerImplementor.n_onClick(本机方法)mono.android.view.View_OnClickListenerImplementor.onClick(View_OnClickListenerImplementor.java:30)在android.view.View.performClick(View.java:4780)处android.view.View $ PerformClick.run(View.java:19866)在android.os.Handler.handleCallback(Handler.java:739)位于android.os.Handler.dispatchMessage(Handler.java:95)在android.os.Looper.loop(Looper.java:135)在android.app.ActivityThread.main(ActivityThread.java:5254)位于java.lang.reflect.Method.invoke(本机方法)位于java.lang.reflect.Method.invoke(Method.java:372)在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:903)在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

Xamarin caused by: android.runtime.JavaProxyThrowable: System.TypeInitializationException: The type initializer for 'SQLite.SQLiteConnection' threw an exception. ---> System.DllNotFoundException: e_sqlite3 at (wrapper managed-to-native) SQLitePCL.SQLite3Provider_e_sqlite3+NativeMethods:sqlite3_libversion_number () at SQLitePCL.SQLite3Provider_e_sqlite3.SQLitePCL.ISQLite3Provider.sqlite3_libversion_number () [0x00000] in :0 at SQLitePCL.raw.SetProvider (SQLitePCL.ISQLite3Provider imp) [0x00000] in <4472a4c16754425197d915f39ebd937e>:0 at SQLitePCL.Batteries_V2.Init () [0x0000d] in <1125db7e18f0475797b2764ec6653cf1>:0 at SQLite.SQLiteConnection..cctor () [0x00000] in /Users/fak/Dropbox/Projects/sqlite-net/src/SQLite.cs:171 --- End of inner exception stack trace --- at mono.android.view.View_OnClickListenerImplementor.n_onClick(Native Method) at mono.android.view.View_OnClickListenerImplementor.onClick(View_OnClickListenerImplementor.java:30) at android.view.View.performClick(View.java:4780) at android.view.View$PerformClick.run(View.java:19866) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

在日志中,我可以看到以下信息:

In the log I can see following info:

12-01 10:43:05.356 D/Mono(11194):DllImport尝试加载:'e_sqlite3'.12-01 10:43:05.358 D/Mono(11194):DllImport错误加载库'/storage/emulated/0/Android/data/com.psonar.android/files/.覆盖/libe_sqlite3':'dlopen失败:库"/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.覆盖/libe_sqlite3"未找到'.12-01 10:43:05.360 D/单声道(11194):DllImport错误加载库'/storage/emulated/0/Android/data/com.psonar.android/files/.覆盖/libe_sqlite3.so':'dlopen失败:库"/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.覆盖/libe_sqlite3.so"未找到'.12-01 10:43:05.360 D/单声道(11194):DllImport错误加载库'/system/lib/libe_sqlite3':'dlopen失败:库"/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3"不成立'.12-01 10:43:05.360 D/单声道(11194):DllImport错误加载库'/system/lib/libe_sqlite3.so':'dlopen失败:库"/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3.so"未找到'.12-01 10:43:05.360 D/单声道(11194):DllImport错误加载库'libe_sqlite3':'dlopen失败:库找不到"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3".12-01 10:43:05.361 D/Mono(11194):DllImport错误加载库'libe_sqlite3.so':'dlopen失败:库找不到"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3.so".12-01 10:43:05.361 D/Mono(11194):DllImport错误加载库'e_sqlite3':'dlopen失败:库找不到"/data/app/com.psonar.android-1/lib/x86/e_sqlite3".12-0110:43:05.362 D/Mono(11194):DllImport错误加载库'/storage/emulated/0/Android/data/com.psonar.android/files/.覆盖/libe_sqlite3':'dlopen失败:库"/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.覆盖/libe_sqlite3"未找到'.12-01 10:43:05.364 D/单声道(11194):DllImport错误加载库'/storage/emulated/0/Android/data/com.psonar.android/files/.覆盖/libe_sqlite3.so':'dlopen失败:库"/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.覆盖/libe_sqlite3.so"未找到'.12-01 10:43:05.364 D/单声道(11194):DllImport错误加载库'/system/lib/libe_sqlite3':'dlopen失败:库"/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3"不成立'.12-01 10:43:05.364 D/单声道(11194):DllImport错误加载库'/system/lib/libe_sqlite3.so':'dlopen失败:库"/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3.so"未找到'.12-01 10:43:05.364 D/单声道(11194):DllImport错误加载库'libe_sqlite3':'dlopen失败:库找不到"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3".12-01 10:43:05.364 D/Mono(11194):DllImport错误加载库'libe_sqlite3.so':'dlopen失败:库找不到"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3.so".12-01 10:43:05.365 D/Mono(11194):DllImport错误加载库'libe_sqlite3':'dlopen失败:库找不到"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3".12-01 10:43:05.365 W/Mono(11194):DllImport无法加载库'dlopen失败:库找不到"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3".12-01 10:43:05.365 D/Mono(11194):DllImport尝试加载:'e_sqlite3'.12-01 10:43:05.366 D/单声道(11194):DllImport错误加载库'/storage/emulated/0/Android/data/com.psonar.android/files/.覆盖/libe_sqlite3':'dlopen失败:库"/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.覆盖/libe_sqlite3"未找到'.12-01 10:43:05.368 D/单声道(11194):DllImport错误加载库'/storage/emulated/0/Android/data/com.psonar.android/files/.覆盖/libe_sqlite3.so':'dlopen失败:库"/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.覆盖/libe_sqlite3.so"未找到'.12-01 10:43:05.368 D/单声道(11194):DllImport错误加载库'/system/lib/libe_sqlite3':'dlopen失败:库"/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3"不成立'.12-01 10:43:05.368 D/Mono(11194):DllImport错误加载库'/system/lib/libe_sqlite3.so':'dlopen失败:库"/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3.so"未找到'.12-01 10:43:05.368 D/单声道(11194):DllImport错误加载库'libe_sqlite3':'dlopen失败:库找不到"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3".12-01 10:43:05.368 D/Mono(11194):DllImport错误加载库'libe_sqlite3.so':'dlopen失败:库找不到"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3.so".12-01 10:43:05.369 D/Mono(11194):DllImport错误加载库'e_sqlite3':'dlopen失败:库找不到"/data/app/com.psonar.android-1/lib/x86/e_sqlite3".12-0110:43:05.370 D/Mono(11194):DllImport错误加载库'/storage/emulated/0/Android/data/com.psonar.android/files/.覆盖/libe_sqlite3':'dlopen失败:库"/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.覆盖/libe_sqlite3"未找到'.12-01 10:43:05.371 D/Mono(11194):DllImport错误加载库'/storage/emulated/0/Android/data/com.psonar.android/files/.覆盖/libe_sqlite3.so':'dlopen失败:库"/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.覆盖/libe_sqlite3.so"未找到'.12-01 10:43:05.372 D/单声道(11194):DllImport错误加载库'/system/lib/libe_sqlite3':'dlopen失败:库"/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3"不成立'.12-01 10:43:05.372 D/单声道(11194):DllImport错误加载库'/system/lib/libe_sqlite3.so':'dlopen失败:库"/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3.so"未找到'.12-01 10:43:05.372 D/单声道(11194):DllImport错误加载库'libe_sqlite3':'dlopen失败:库找不到"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3".12-01 10:43:05.372 D/Mono(11194):DllImport错误加载库'libe_sqlite3.so':'dlopen失败:库找不到"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3.so".12-01 10:43:05.373 D/Mono(11194):DllImport错误加载库'libe_sqlite3':'dlopen失败:库找不到"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3".12-01 10:43:05.373 W/Mono(11194):DllImport无法加载库'dlopen失败:库找不到"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3".

12-01 10:43:05.356 D/Mono (11194): DllImport attempting to load: 'e_sqlite3'. 12-01 10:43:05.358 D/Mono (11194): DllImport error loading library '/storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3" not found'. 12-01 10:43:05.360 D/Mono (11194): DllImport error loading library '/storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3.so': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3.so" not found'. 12-01 10:43:05.360 D/Mono (11194): DllImport error loading library '/system/lib/libe_sqlite3': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3" not found'. 12-01 10:43:05.360 D/Mono (11194): DllImport error loading library '/system/lib/libe_sqlite3.so': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3.so" not found'. 12-01 10:43:05.360 D/Mono (11194): DllImport error loading library 'libe_sqlite3': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86/libe_sqlite3" not found'. 12-01 10:43:05.361 D/Mono (11194): DllImport error loading library 'libe_sqlite3.so': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86/libe_sqlite3.so" not found'. 12-01 10:43:05.361 D/Mono (11194): DllImport error loading library 'e_sqlite3': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86/e_sqlite3" not found'. 12-01 10:43:05.362 D/Mono (11194): DllImport error loading library '/storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3" not found'. 12-01 10:43:05.364 D/Mono (11194): DllImport error loading library '/storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3.so': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3.so" not found'. 12-01 10:43:05.364 D/Mono (11194): DllImport error loading library '/system/lib/libe_sqlite3': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3" not found'. 12-01 10:43:05.364 D/Mono (11194): DllImport error loading library '/system/lib/libe_sqlite3.so': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3.so" not found'. 12-01 10:43:05.364 D/Mono (11194): DllImport error loading library 'libe_sqlite3': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86/libe_sqlite3" not found'. 12-01 10:43:05.364 D/Mono (11194): DllImport error loading library 'libe_sqlite3.so': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86/libe_sqlite3.so" not found'. 12-01 10:43:05.365 D/Mono (11194): DllImport error loading library 'libe_sqlite3': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86/libe_sqlite3" not found'. 12-01 10:43:05.365 W/Mono (11194): DllImport unable to load library 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86/libe_sqlite3" not found'. 12-01 10:43:05.365 D/Mono (11194): DllImport attempting to load: 'e_sqlite3'. 12-01 10:43:05.366 D/Mono (11194): DllImport error loading library '/storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3" not found'. 12-01 10:43:05.368 D/Mono (11194): DllImport error loading library '/storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3.so': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3.so" not found'. 12-01 10:43:05.368 D/Mono (11194): DllImport error loading library '/system/lib/libe_sqlite3': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3" not found'. 12-01 10:43:05.368 D/Mono (11194): DllImport error loading library '/system/lib/libe_sqlite3.so': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3.so" not found'. 12-01 10:43:05.368 D/Mono (11194): DllImport error loading library 'libe_sqlite3': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86/libe_sqlite3" not found'. 12-01 10:43:05.368 D/Mono (11194): DllImport error loading library 'libe_sqlite3.so': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86/libe_sqlite3.so" not found'. 12-01 10:43:05.369 D/Mono (11194): DllImport error loading library 'e_sqlite3': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86/e_sqlite3" not found'. 12-01 10:43:05.370 D/Mono (11194): DllImport error loading library '/storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3" not found'. 12-01 10:43:05.371 D/Mono (11194): DllImport error loading library '/storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3.so': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3.so" not found'. 12-01 10:43:05.372 D/Mono (11194): DllImport error loading library '/system/lib/libe_sqlite3': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3" not found'. 12-01 10:43:05.372 D/Mono (11194): DllImport error loading library '/system/lib/libe_sqlite3.so': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3.so" not found'. 12-01 10:43:05.372 D/Mono (11194): DllImport error loading library 'libe_sqlite3': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86/libe_sqlite3" not found'. 12-01 10:43:05.372 D/Mono (11194): DllImport error loading library 'libe_sqlite3.so': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86/libe_sqlite3.so" not found'. 12-01 10:43:05.373 D/Mono (11194): DllImport error loading library 'libe_sqlite3': 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86/libe_sqlite3" not found'. 12-01 10:43:05.373 W/Mono (11194): DllImport unable to load library 'dlopen failed: library "/data/app/com.psonar.android-1/lib/x86/libe_sqlite3" not found'.

很明显出了什么问题: System.DllNotFoundException:e_sqlite3 ,但是我找不到任何相关信息可以解决此问题.

It's obvious what's wrong: System.DllNotFoundException: e_sqlite3 however I can't find any relevant info that would lead to solving this problem.

我检查了我的nuget软件包,它们似乎都已正确安装.

I checked my nuget packages and they all seem to be correctly installed.

我检查了包裹的位置,并且都正确无误.非常不确定原因可能在哪里.

I checked the package location and it is all correct. Very unsure where the cause might be.

在这里向软件包的作者报告: https://github.com/praeclarum/sqlite-net/issues/478

Reported to the author of the package in here: https://github.com/praeclarum/sqlite-net/issues/478

推荐答案

nuget包也必须安装在我们的主要droid应用项目中.如果将它安装在不是应用程序启动项目的解决方案项目中,则会产生这些问题.

The nuget package had to be installed in our main droid app project as well. If it is installed in a solution project which is not the app start project then it creates these problems.

这篇关于Android-'SQLite.SQLiteConnection'的类型初始值设定项引发了异常.---&gt;System.DllNotFoundException:e_sqlite3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆