Unable to deploy and to debug after updating VS and nuget packages

jddjdd USMember ✭✭✭

Hello,

I have updated VS and nuget packages. As usual, I meet problems.

First, my Xamarin.Forms Droid Project (targeting Android 8.1) compiles but I cannot debug on my Huawei ANE-LX1 using Android 9.

After successful build, I get this warning:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2798,3): warning MSB3277: Found conflicts between different versions of "SQLitePCLRaw.provider.e_sqlite3" that could not be resolved.

After debugging, I cannot deploy and get this error:
Severity Code Description Project File Line Suppression State
Error MSB4018: The "LinkAssemblies" task failed unexpectedly.
Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Could not resolve reference to 'SQLitePCL.delegate_progress_handler' (defined in assembly 'SQLitePCLRaw.provider.e_sqlite3, Version=1.1.14.520, Culture=neutral, PublicKeyToken=9c301db686d0bd12') with scope 'SQLitePCLRaw.core, Version=1.1.14.520, Culture=neutral, PublicKeyToken=1488e028ca7ab535'. When the scope is different from the defining assembly, it usually means that the type is forwarded. ---> Mono.Cecil.ResolutionException: Failed to resolve SQLitePCL.delegate_progress_handler
at Mono.Linker.Steps.MarkStep.HandleUnresolvedType(TypeReference reference)
at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
at Mono.Linker.Steps.MarkStep.MarkField(FieldReference reference)
at Mono.Linker.Steps.MarkStep.InitializeFields(TypeDefinition type)
at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type)
at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)
at Mono.Linker.Steps.MarkStep.Initialize()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
--- End of inner exception stack trace ---
at Java.Interop.Tools.Diagnostics.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() 0

I have updated my EDI to:
Microsoft Visual Studio Community 2019
Version 16.3.5
VisualStudio.16.Release/16.3.5+29411.108
Microsoft .NET Framework
Version 4.8.03752

Xamarin.Android SDK 10.0.3.0 (d16-3/4d45b41)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: mono/mono/[email protected]
Java.Interop: xamarin/java.interop/[email protected]
LibZipSharp: grendello/LibZipSharp/[email protected]
LibZip: nih-at/libzip/[email protected]
ProGuard: xamarin/proguard/[email protected]
SQLite: xamarin/sqlite/[email protected]
Xamarin.Android Tools: xamarin/xamarin-android-tools/[email protected]

sqlite-net-pcl 2.0.1
SQLitePCLRaw v2.0.1

Xamarin.Forms v4.3.0.947036

Any idea how to debug?
I tried to delete bin and obj and to reinstall nuget packages unsuccessfully.

Best Answer

Answers

  • PilliPilli USMember ✭✭
    edited November 1

    https://docs.microsoft.com/en-us/xamarin/xamarin-forms/troubleshooting/questions/android-linkassemblies-error
    &
    Try Uncheck Common Language RunTime Exceptions
    & Turn off Hot Reload until successful deploy.

    I remember faced that error long ago. Give it a try, I'm not sure.

  • jddjdd USMember ✭✭✭

    Hello,
    Thank you for your help.
    I target Android 9
    I reinstall all nuget packages
    I deleted bin and obj and rebuilt the solution.
    I still have the same warnings and error.

  • jddjdd USMember ✭✭✭

    I tried on a virutal device and get the same issue.
    Could it be a SQLitePCLRaw NuGet package error?

    Severity Code Description Project File Line Suppression State
    Error MSB4018: The "LinkAssemblies" task failed unexpectedly.
    Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Could not resolve reference to 'SQLitePCL.delegate_progress_handler' (defined in assembly 'SQLitePCLRaw.provider.e_sqlite3, Version=1.1.14.520, Culture=neutral, PublicKeyToken=9c301db686d0bd12') with scope 'SQLitePCLRaw.core, Version=1.1.14.520, Culture=neutral, PublicKeyToken=1488e028ca7ab535'. When the scope is different from the defining assembly, it usually means that the type is forwarded. ---> Mono.Cecil.ResolutionException: Failed to resolve SQLitePCL.delegate_progress_handler
    at Mono.Linker.Steps.MarkStep.HandleUnresolvedType(TypeReference reference)
    at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
    at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
    at Mono.Linker.Steps.MarkStep.MarkField(FieldReference reference)
    at Mono.Linker.Steps.MarkStep.InitializeFields(TypeDefinition type)
    at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type)
    at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)
    at Mono.Linker.Steps.MarkStep.Initialize()
    at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
    at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
    at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
    at Mono.Linker.Pipeline.Process(LinkContext context)
    at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
    at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
    --- End of inner exception stack trace ---
    at Java.Interop.Tools.Diagnostics.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args)
    at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
    at Xamarin.Android.Tasks.LinkAssemblies.Execute()
    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
    at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() 0

  • jddjdd USMember ✭✭✭

    I have updated the SQLitePCLRaw nuget packages to v 2.0.2 (11/1) and still meet the same error.

  • jddjdd USMember ✭✭✭

    Hello,
    Thank you for your answer.
    I am using sqlite-net-pcl 1.6.292.
    So I need either:

    • to upgrade sqlite-net-pcl 1.7-beta
    • or to unupgrade to SQLitePCLRaw 1.x
      I try that.
Sign In or Register to comment.