0

I’m developing an app using Xamarin currently targeting Android devices but using Forms packages to target iOS devices as well. I’m using EntityFrameworkCore and Sqlite database to manage the app data. The problem I’ve being having is on Samsung Galaxy devices where this configuration fails raising the following exception. Unfortunately, it only happens on Samsung devices and on other devices the app works great. Do you have any ideas on how to fix that? Thank you very much for your time

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 "
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • Since you do not include any code, it's unlikely anyone will be able to help you. – miken32 Jun 28 '17 at 23:48
  • Hi Mike, unfortunately it's not a problem with the code, the app is working fine on other devices except by the Samsung Galaxy ones. I've verified the app has the permissions in the manifest and in runtime to access device storage and at runtime. Anyway, I'm getting ready sample of the app with just the setup needed to make the problem happen. I asking because it has to be related with that kind of device. – Jorge Luis Calderín García Jul 02 '17 at 16:01
  • Hi Mike, here you have a link to a sample project I made to recreate the same issue on the app: https://github.com/jlcalderingarcia/XamarinEntityFrameworkSqliteError – Jorge Luis Calderín García Jul 02 '17 at 16:29

0 Answers0