In my project I use a package Microsoft.EntityFrameworkCore.SQLitefrom NuGet. But for Android 7+, the application crashes withunauthorized access to "/system/lib64/libsqlite.so".
This is due to the fact that Android 7 does not allow you to create your own libraries other than those in the NDK (as I understand it). Also see this issue: https://github.com/aspnet/EntityFramework/issues/7777 .
So, I’ve been researching the Internet for about 2 days and tried unsuccessfully a bunch of things to get EFCore to work on Android 7. One of them was updating to the preview version v2.0.0-preview1-final. But this led to other problems, like the following, where the application was compiled, but crashed when deployed / launched 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.
Then I tried to manually add the “System.Runtime.CompilerServices.Unsafe” NuGet package to my project, but it did not fix the problem. I mixed up a lot, tried different build parameters and the like, and actually got an application that works with the EFCore preview package on the Android 7 emulator. However, after cleaning and restoring the project, the error appeared again.
Any help on how to get EFCore Sqlite to work on Android 7?
I am using Visual Studio 2017 with Xamarin.Android 7.3.1.2
I created a sample project to reproduce the problem: https://github.com/tipa/EFCoreSample - Basically just started with the basic Android template from VS and the Nuget package was added