I was successfully using Microsoft.EntityFrameworkCore.SQLite v.1.1.2 in a Xamarin.Android project. But for Android 7+, the app crashes with unauthorized access to "/system/lib64/libsqlite.so" (as reported here).
So I updated to version v2.0.0-preview1-final as this should fix the issue.
However, this results in other problems like the following where the app compiled, but crashed while deploying/starting on the emulator:
...
06-21 09:58:18.970 D/Mono ( 3632): Assembly Loader probing location: 'System.Runtime.CompilerServices.Unsafe'.
06-21 09:58:18.970 F/monodroid-assembly( 3632): Could not load assembly 'System.Runtime.CompilerServices.Unsafe' during startup registration.
06-21 09:58:18.970 F/monodroid-assembly( 3632): This might be due to an invalid debug installation.
I then tried to add the 'System.Runtime.CompilerServices.Unsafe' NuGet package manually to my project, but it didnt fix the problem. I messed around a lot, trying different build parameters and such and actually got the app running on an Android 7 emulator. However, after a project clean and rebuild, the error showed up again.
Any help on how to get EFCore Sqlite to work on Android 7?
Steps to reproduce
Sample project: https://github.com/tipa/EFCoreSample
(Basically just the basic Android template from VS + the Nuget preview package)
Further technical details
EF Core version: v2.0.0-preview1-final
Database Provider: Microsoft.EntityFrameworkCore.Sqlite
Xamarin: 4.5.0.486
Xamarin.Android: 7.3.1.2
Operating system: Windows 10
IDE: Visual Studio 2017 15.2
I was successfully using
Microsoft.EntityFrameworkCore.SQLite v.1.1.2in a Xamarin.Android project. But for Android 7+, the app crashes withunauthorized access to "/system/lib64/libsqlite.so"(as reported here).So I updated to version
v2.0.0-preview1-finalas this should fix the issue.However, this results in other problems like the following where the app compiled, but crashed while deploying/starting on the emulator:
I then tried to add the 'System.Runtime.CompilerServices.Unsafe' NuGet package manually to my project, but it didnt fix the problem. I messed around a lot, trying different build parameters and such and actually got the app running on an Android 7 emulator. However, after a project clean and rebuild, the error showed up again.
Any help on how to get EFCore Sqlite to work on Android 7?
Steps to reproduce
Sample project: https://github.com/tipa/EFCoreSample
(Basically just the basic Android template from VS + the Nuget preview package)
Further technical details
EF Core version: v2.0.0-preview1-final
Database Provider: Microsoft.EntityFrameworkCore.Sqlite
Xamarin: 4.5.0.486
Xamarin.Android: 7.3.1.2
Operating system: Windows 10
IDE: Visual Studio 2017 15.2