SQLitePCL.raw icon indicating copy to clipboard operation
SQLitePCL.raw copied to clipboard

System.Memory dependency causing issue with Xamarin.iOS targets

Open prollin opened this issue 3 years ago • 3 comments
trafficstars

Since 2.x. SQLitePCL.raw.core targets NET Standard 2.0 and references System.Memory This causes an incompatibility in Xamarin.iOS projects referencing SQLitePCL.raw since a few types from System.Memory (ReadonlySpan, Span...) are already declared in mscorlib

So far I have failed to find a workaround that doesn't require a change to SQLitePCL.raw.core project.

A possible solution would be to explicitly add xamarin.ios10 TFM (and monodroid90, changing the sdk to Xamarin.Legacy.Sdk) to SQLitePCL.raw.core.csproj and avoid the dependency to System.Memory for those target frameworks

prollin avatar Oct 10 '22 22:10 prollin

Possibly related to #462 ?

ericsink avatar Oct 11 '22 01:10 ericsink

What I'm curious about: This was all working just fine for a long time. Sometime during the .NET 6 cycle is when I started getting reports of #462. Did something about the Xamarin classic platform change during that timeframe?

ericsink avatar Oct 11 '22 01:10 ericsink

IIRC, I have seen this issue pop on and off since VS 2017 (on various packages). This is the most "root cause" issue I could find on the subject: https://github.com/dotnet/runtime/issues/29209

In my case, explicitly excluding System.Memory 4.5.3 by adding the following to the project referencing the latest version of SQLitePCL.raw seem to work:

<PackageReference Include="System.Memory" Version="4.5.3">
  <ExcludeAssets>all</ExcludeAssets>
</PackageReference>

Explicitly targeting Xamarin.iOS might be a better solution if more ppl are running into this issue though.

prollin avatar Oct 11 '22 04:10 prollin