You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The build fails at the linker stage, with the following error:
Xamarin.Android.Common.targets(1812,5): error MSB4018: The "LinkAssemblies" task failed unexpectedly.
Xamarin.Android.Common.targets(1812,5): error MSB4018: Mono.Linker.MarkException: Error processing method: 'System.ReadOnlySpan`1<System.Char> Microsoft.Extensions.Primitives.StringSegment::AsSpan()' in assembly: 'Microsoft.Extensions.Primitives.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.ReadOnlySpan`1<System.Char> System.MemoryExtensions::AsSpan(System.String,System.Int32,System.Int32)
Xamarin.Android.Common.targets(1812,5): error MSB4018: at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
Xamarin.Android.Common.targets(1812,5): error MSB4018: at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
Xamarin.Android.Common.targets(1812,5): error MSB4018: at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
Xamarin.Android.Common.targets(1812,5): error MSB4018: at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
Xamarin.Android.Common.targets(1812,5): error MSB4018: at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
Xamarin.Android.Common.targets(1812,5): error MSB4018: at Mono.Linker.Steps.MarkStep.ProcessQueue()
Xamarin.Android.Common.targets(1812,5): error MSB4018: --- End of inner exception stack trace ---
Xamarin.Android.Common.targets(1812,5): error MSB4018: at Mono.Linker.Steps.MarkStep.ProcessQueue()
Xamarin.Android.Common.targets(1812,5): error MSB4018: at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
Xamarin.Android.Common.targets(1812,5): error MSB4018: at Mono.Linker.Steps.MarkStep.Process()
Xamarin.Android.Common.targets(1812,5): error MSB4018: at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
Xamarin.Android.Common.targets(1812,5): error MSB4018: at Mono.Linker.Pipeline.Process(LinkContext context)
Xamarin.Android.Common.targets(1812,5): error MSB4018: at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
Xamarin.Android.Common.targets(1812,5): error MSB4018: at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
Xamarin.Android.Common.targets(1812,5): error MSB4018: at Xamarin.Android.Tasks.LinkAssemblies.Execute()
Xamarin.Android.Common.targets(1812,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
Xamarin.Android.Common.targets(1812,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
FWIW, if you were to downgrade the Microsoft.EntityFrameworkCore.Sqlite package to 2.0.3, which no longer indirectly depends on System.Memory 4.5, then the project builds and is deployed to device.
Steps to Reproduce
Download, extract, and load the sample solution in Visual Studio 15.7.3:
AndroidEFCore21LinkedSoln.zip
Note: This is the same sample solution as I created for Android app build fails when referencing package (e.g. Entity Framework Core 2.1) that depends on newer System.Memory #1769 (now closed, fixed in 15.7.3) except I modified the project's Debug configuration AndroidLinkMode setting from None to SdkOnly.
Build the project.
Expected Behavior
The project should build and deploy to device.
Actual Behavior
The build fails at the linker stage, with the following error:
FWIW, if you were to downgrade the
Microsoft.EntityFrameworkCore.Sqlitepackage to 2.0.3, which no longer indirectly depends onSystem.Memory4.5, then the project builds and is deployed to device.Version Information
Log File
adb logcatoutput is not applicable as the app didn't even build.Example Project
AndroidEFCore21LinkedSoln.zip