-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Microsoft.EntityFrameworkCore.SQLite on Android 7+ not working #8922
Comments
Any comments/updates on this? |
Have you tried again with EF Core version 2.0.0 and Xamarin.Android 7.5? |
How can I test it with Xamarin.Android 7.5? Version 7.4 was just released a few days ago |
@tipa Xamarin Updater Extension for VS 2017 (market). For older version of VS you can switch channels in vs->options->xamarin (not sure if alpha or beta). |
@erikpowa that means I am forced to use VS17 Preview in order to use Xamarin.Android 7.5, is that correct? I would probably even do that if that finally resolves that issue. Edit: well, downloaded VS17 preview + Xamarin.Android 7.5, however they still seem to be very beta, I encounter several issues which make it impossible for me to even compile the app. |
I have the same issue on the current stable and on the preview of Xamarin. But I still have the same issue.. |
(Marking for re-triage. Xamarin supports .NET Standard 2.0 now, but this still seems to be blocked.) |
Hi, this is very serious for us, since we are already shipping the Android app with netstandard1.4. |
If you target 6.0 with your app and use EF 1.x it should work on Android 7+ as well. There is a message shown sometimes when you start, but you can just hit ok and it should be functional. |
Thank you! Didn't think there was an easy solution like this (though i also added this: #7870). |
ah right. that one is also an important one :) Glad it worked :) |
Any updates on this? Same problem exists with Xamarin.Android 8.0 and VS17 Update 4. |
It seems the issue only appears with either project.json or package ref. With the old packages.config it seems to work so far. |
I have the same problem, an update would be much appreciated |
We're having the same issue using EF Core 2.0.1 in VS 15.4.3 and VS 15.5 Preview 3 with no luck. This is annoying because the Xamarin application is now blocked because of this. |
|
Thanks - while both of your suggestions work, they feel like a workaround. Would be awesome if we wouldnt have to use them in the future |
@erikpowa We are in the point 2, using PackageReference. I cannot install System.Runtime.CompilerServices.Unsafe 4.3.0 because EF Core 2.0.0 uses the 4.4.0 version, so NuGet detects a package downgrade, and does not let me install 4.3.0. |
I investigated this a little. It seems like I have downloaded the NuGet Package This is my previous workaround: @alexdrl I think the following trick is necessary to make it work. Manually edit the <PropertyGroup>
<NoWarn>$(NoWarn);NU1605</NoWarn>
</PropertyGroup> Then in your Project File add the <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.3.0" /> Then I would:
After a successful build your Xamarin App should start with Entity Framework 2.0. 👍 |
@bytefish @erikpowa That workaround worked good... as we're working closely to the latest version of .NET Core/Standard and Xamarin, could you give us some explanation of why is this happening? Thank you for the workaround. Also, as we have found with other package version mismatch, this package downgrade workaround breaks the assemblies linking. |
When I add the System.Runtime.CompilerServices.Unsafe package I get an Exception during linking:
So I have to set the linker to "None" instead of "SDK Assemblies only". Is there a work around for that? I already set the entry mentioned by @bytefish . This happens on VS15.5. |
This is still an issue? is this being worked on or should i move to a more stable library for a new project? |
I had to move to Dapper because of this problem which works great on mobile but doesn't do migrations. |
I was using EF Core 2.0 just fine, and then issue only started occuring for me after I moved from
Linker set to Any ideas? |
We are tracking this issue in the following github issues: |
Using packages.config instead of package references works around the problem. |
Hey guys, not that it helps- but we had 3+ devs in our company alone run into this issue. So, for what it's worth, I don't think this is an isolated problem. Latest Xamarin.Forms (.NET Standard) project + EntityFrameworkCore == runtime exception that only shows when deploying to an emulator. Thanks, |
@dfoulk it's even wider since it affects far more than EntityFrameworkCore. However, the workaround I've described does the job. For more details see dotnet/android#1196 (comment) and below. |
@ddobrev - Yes, thank you for that. We're converting these projects to package.config- but a few errors seem to be preventing us from deploying still... After following the instructions you provided in another thread:
styles.xml has apparently ran into some issues as a result :( Update: Something was wrong with our initial conversion. We reverted and tried again and all ended up okay... Thanks again! |
@dfoulk you're welcome. About that error, your conversion was just fine - it's just that Xamarin.Android is notoriously poor at rebuilding. Every time a major restructuring, such as yours, takes place, the only way to properly rebuild everything is after deleting your bin/ and obj/ - that is, neither rebuild nor clean + build work in such cases. |
Any news here? I cannot go back to 1.3 :( And really need EF with SQLite to work on our app in Android. How is this long delay of a fix even possible? :( |
I am using it in our monodroid 8 app - it is working.. I had to convert the project to using packages.xml instead of packagereference though.. I'm waiting for this issue to be fixes so that I can convert back to packagereference and drop packages.xml again.. |
yes, it's the package reference scenario I want them to fix. It has been many converts back and forth already, because of other libs and I'm done spending time converting, my clients do not pay for that job :( |
Clearing milestone to decide in triage whether we want to keep this for tracking purposes or whether we should close. The underlying issues in Xamarin Android are now tracked in dotnet/android#1154 and dotnet/android#1196. |
Thanks for the update @divega |
I was successfully using
Microsoft.EntityFrameworkCore.SQLite v.1.1.2
in 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-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:
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
The text was updated successfully, but these errors were encountered: