Android 由于三星Galaxy设备上的EntityFrameworkCore Sqlite数据库文件访问被拒绝,Xamarin应用程序失败

Android 由于三星Galaxy设备上的EntityFrameworkCore Sqlite数据库文件访问被拒绝,Xamarin应用程序失败,android,sqlite,xamarin,entity-framework-core,samsung-galaxy,Android,Sqlite,Xamarin,Entity Framework Core,Samsung Galaxy,我正在使用Xamarin开发一个应用程序,该应用程序目前针对Android设备,但也使用表单包针对iOS设备。我正在使用EntityFrameworkCore和Sqlite数据库来管理应用程序数据。 我遇到的问题是,在三星Galaxy设备上,此配置失败,引发以下异常。不幸的是,这只发生在三星设备和其他设备上,应用程序工作得很好。 你对如何解决这个问题有什么想法吗? 非常感谢您抽出时间 Exception: "SQLite Error 1294: 'unable to open database

我正在使用Xamarin开发一个应用程序,该应用程序目前针对Android设备,但也使用表单包针对iOS设备。我正在使用EntityFrameworkCore和Sqlite数据库来管理应用程序数据。 我遇到的问题是,在三星Galaxy设备上,此配置失败,引发以下异常。不幸的是,这只发生在三星设备和其他设备上,应用程序工作得很好。 你对如何解决这个问题有什么想法吗? 非常感谢您抽出时间

Exception:
"SQLite Error 1294: 'unable to open database file'."

File path used: "/data/user/0/app.package.name/files/rr.db"

Stack trace:
"  at Microsoft.EntityFrameworkCore.Storage.RelationalDatabaseCreator.EnsureCreated () [0x00000] in <1ce4ae811dd94fe5a5e10e630f2f4c7a>:0 \n  at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.EnsureCreated () [0x00006] in <2645c1c7345546f5b968e91de81e2b12>:0 \n  at DataAccess.DataService.Sync (Framework.Dtos.SyncDataDto data) [0x00058] in /Users/JLC/Projects/RackAndRollApp/DataAccess/DataService.cs:44 \n  at RackAndRollApp.Services.SyncService+<>c__DisplayClass4_0.<Sync>b__0 () [0x00001] in /Users/JLC/Desktop/Rack&Roll/code/svn/trunk/RackAndRollApp/RackAndRollApp/Services/SyncService.cs:34 \n  at System.Threading.Tasks.AwaitTaskContinuation.InvokeAction (System.Object state) [0x00000] in <3fd174ff54b146228c505f23cf75ce71>:0 \n  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <3fd174ff54b146228c505f23cf75ce71>:0 \n  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <3fd174ff54b146228c505f23cf75ce71>:0 \n  at System.Threading.Tasks.AwaitTaskContinuation.RunCallback (System.Threading.ContextCallback callback, System.Object state, System.Threading.Tasks.Task& currentTask) [0x0001a] in <3fd174ff54b146228c505f23cf75ce71>:0 \n--- End of stack trace from previous location where exception was thrown ---\n  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <3fd174ff54b146228c505f23cf75ce71>:0 \n  at System.Threading.Tasks.AwaitTaskContinuation+<>c.<ThrowAsyncIfNecessary>b__17_0 (System.Object s) [0x00000] in <3fd174ff54b146228c505f23cf75ce71>:0 \n  at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x00007] in <3fd174ff54b146228c505f23cf75ce71>:0 \n  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <3fd174ff54b146228c505f23cf75ce71>:0 \n  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <3fd174ff54b146228c505f23cf75ce71>:0 \n  at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00021] in <3fd174ff54b146228c505f23cf75ce71>:0 \n  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <3fd174ff54b146228c505f23cf75ce71>:0 \n  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <3fd174ff54b146228c505f23cf75ce71>:0 "
异常:
“SQLite错误1294:'无法打开数据库文件'。”
使用的文件路径:“/data/user/0/app.package.name/files/rr.db”
堆栈跟踪:
“在Microsoft.EntityFrameworkCore.Storage.RelationalDatabaseCreator.EnsureCreated()[0x00000]in:0\n在Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.EnsureCreated()[0x00006]in:0\n在DataAccess.DataService.Sync(Framework.Dtos.SyncDataDto数据)[0x00058]在/Users/JLC/Projects/RackAndRollApp/DataAccess/DataService.cs:44\n在RackAndRollApp.Services.SyncService+c_u_udisplayClass4_0.b_u0()[0x00001]in/Users/JLC/Desktop/Rack&Roll/code/svn/trunk/RackAndRollApp/RackAndRollApp/Services/SyncService.cs:34\n在System.Threading.Tasks.Tasks.waittaskcontinuation.InvokeAction(System.Object状态)[0x00000]in:0\n位于System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext ExecutionContext,System.Threading.ContextCallback回调,System.Object状态,System.Boolean preserveSyncCtx)[0x00071]in:0\n位于System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext ExecutionContext,System.Threading.ContextCallback回调,System.Object状态,System.Boolean preserveSyncCtx)[0x00000]in:0\n位于System.Threading.Tasks.AwaitTaskContinuation.RunCallback(System.Threading.ContextCallback回调,System.Object状态,System.Threading.Tasks.Tasks和currentTask)[0x0001a]in:0\n---从引发异常的上一个位置开始的堆栈结束跟踪---\n在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()[0x0000c]中:0\n在System.Threading.Tasks.WaitTaskContinuation+c.b_u17_0(System.Object s)[0x00000]中:0\n在System.Threading.QueueUserWorkItemCallback.WaitCallback\u上下文中(System.Object state)[0x00007]in:0\n位于System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext ExecutionContext,System.Threading.ContextCallback回调,System.Object state,System.Boolean preserveSyncCtx)[0x00071]in:0\n位于System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext ExecutionContext,System.Threading.ContextCallback callback,System.Object state,System.Boolean preserveSyncCtx)[0x00000]in:0\n at System.Threading.QueueUserWorkItemCallback.System.ThreadPoolWorkItem()[0x00021]in:0\n at System.Threading.ThreadPoolWorkQueue.Dispatch()[0x00074]in:0\n位于System.Threading.\u ThreadPoolWaitCallback.PerformWaitCallback()[0x00000]in:0”

由于您没有包含任何代码,因此不太可能有人能够帮助您。嗨,迈克,不幸的是,代码没有问题,该应用程序在除三星Galaxy以外的其他设备上运行良好。我已验证该应用程序在清单和运行时具有访问设备存储和运行时的权限。无论如何,我是ge正在准备应用程序的示例,其中仅包含发生问题所需的设置。我之所以这样问,是因为它必须与此类设备相关。嗨,迈克,这里有一个链接,指向我为在应用程序上重新创建相同问题而创建的示例项目: