The AppCenter SDK will not work correctly with UWP apps built with .NET Native unless the following runtime directive is used:
<Assembly Name="SQLite-net" Dynamic="Required All" />
cf https://devblogs.microsoft.com/dotnet/net-native-deep-dive-making-your-library-great/
Please list the steps used to reproduce your issue.
<Assembly Name="*Application*" Dynamic="Required All" /> directive from the app's rd.xml fileWhat is your app platform (Xamarin.Android or Xamarin.iOS or UWP)?
UWP
Which SDK version are you using?
2.1.1
Which OS version did you experience the issue on?
Windows 10 18363
What device version did you see this error on? Were you using an emulator or a physical device?
PC
What third party libraries are you using?
Available on demand, but it doesn't matter.
Please enable verbose logging for your app using AppCenter.LogLevel = LogLevel.Verbose before your call to AppCenter.Start(...) and include the logs here:
Also available on demand, but probably not needed to reproduce the problem.
Thanks!
Hello @mfeingol ! Thank you for creating an issue. We are looking in to it.
@mfeingol That sounds like a bug, thanks for reporting it. We will let you know once the fix is ready but it might be delayed. Do you have a workaround in the meantime?
Yes, thank you. The workaround is to explicitly mention SQLite-net in the app's rd.xml file.
(Since this takes some discovery, ideally it wouldn't be needed.)
AppCenter no longer depends on that library so the directive should not be necessary anymore. Here is the changelog for version 3.0.0.
Hi, @guperrot
I saw this release today and decided to give it a spin in my UWP app. After updating to the new AppCenter packages, I'm seeing MissingMethodExceptions in SQLitePCLRaw.core.dll when running binaries built with .NET Native. However, adding that assembly to the rd.xml file doesn't seem to help.
I saw this change in your changelist:
[Dependency changes] Update SQLitePCLRaw.bundle_green dependency to version 2.0.2 and remove dependency from sqlite-net-pcl.
I believe the root cause is that SQLitePCLRaw.bundle_green 2.x wants EF Core 3.x, which has major breaking changes from 2.x and I'm not even sure it's supposed to work on UWP. So if your UWP app is using EF Core 2.x, it's also using SQLitePCLRaw.bundle_green 1.x and I believe that makes it incompatible with the new AppCenter 3.x SDK.
I'm not sure what to suggest, other than finding a way to make this dependency chain clear.
Yes the AppCenter SDK 3.0 is incompatible with SQLitePCLRaw.bundle_green 1.x. It requires 2.x.
I am not familiar with EF Core at all, is upgrading to version 3 an option for you? Since the original issue is different, can you create a new one?
Truth be told, I'm not even sure what the title of the GHI would be. The issue is that we can no longer use AppCenter SDK 3.x with Entity Framework Core 2.x, at least if we're using the latter with SQLite. But from your perspective, that's kind of by design. If you used SQLitePCLRaw.bundle_green 1.x, I guess you'd be incompatible with apps already on 2.x?
Anyway, I looked into EF Core 3.x a little more and they've switched back to using .NET Standard 2.0 in 3.1 (EF 3.0 was using .NET Standard 2.1). That means it's at least viable to use 3.1 in a UWP app. However, the list of breaking changes is somewhat mind-boggling.
https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-3.0/breaking-changes
I guess the next step is to go through those and fix up my app... It's going to be a lot of work.
It looks like the upgrade is unfortunately inevitable, one of the reasons we had to update sqlite to version 2.x is to support the arm64 architecture, we can't really go back to 1.x as only 2.x has arm64 architecture support.