Unable to load DLL 'sqlite3.dll': The specified module could not be found in UWP Xamarin.Forms

孤人 提交于 2019-12-12 13:51:42

问题


I am trying to write app for UWP Xamarin.Forms with use of Azure Mobile SQLiteStore package.

I struggle with SQLitePCL package which is dependency of that mentioned above package.

In my UWP project I referenced extension SQLite for Universal Windows Platform also it's dependency Microsoft.VCLibs

Error is : Unable to load DLL 'sqlite3.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Android app works fine, only UWP has this problem crashing app as soon as it start to call SQLite.

And Stacktrace:

at SQLitePCL.SQLiteConnection.SetTemporaryDirectory()
at SQLitePCL.SQLiteConnection..ctor(String fileName, SQLiteOpen openFlag, Boolean setTemporaryDirectory)
at Microsoft.WindowsAzure.MobileServices.SQLiteStore.MobileServiceSQLiteStore..ctor(String fileName)
at WellDoneIt.Services.WellDoneItMobileService.d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at WellDoneIt.Services.WellDoneItMobileService.d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at WellDoneIt.ViewModel.ListViewModel.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at WellDoneIt.ViewModel.ListViewModel.<<-ctor>b__2_2>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__6_0(Object state)
at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()

Anyone knows how to solve this issue?

Update: I have also double checked processor architecture and for emulator it is set to x86, and for real Win10 Mobile device it is set to ARM.

On both getting exactly the same issue. However when I run my app on local machine (my Windows 10 OS I develop on) everything works fine.

Thanks in advance.


回答1:


You need to add a reference to SQLite for windows platforms.

On your UWP project go to Add References.

Go to Universal Windows > Extensions

Then make sure you tick SQLite for Universal App Platform




回答2:


I have struggled for hours with what could be the same problem.

I upgraded the SQLite to the latest version and I think this is where the problem began.

I downloaded Visual Studio 2015 Update 2, ran and selected modify. Then ensured all the highlighted updates were ticked and the deprecated items are un-ticked. (Update 2 is included in the latest community download)

I hope this works for you.



来源:https://stackoverflow.com/questions/36521860/unable-to-load-dll-sqlite3-dll-the-specified-module-could-not-be-found-in-uwp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!