Skip to content
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

Android release build: Could not resolve reference to 'SQLitePCL.delegate_progress_handler' #384

Closed
zoli13 opened this issue Dec 7, 2020 · 2 comments

Comments

@zoli13
Copy link

zoli13 commented Dec 7, 2020

We updated in XF project the Android TargetSDK to 29 - which caused lots of "chain reaction", upgrading MvvmCross, Xamarin Forms, AndroidX, etc,etc.
Finally, all worked fine, in debug mode.

But in release (AndroidLinkMode=SdkOnly), we have linker error:

Severity	Code	Description	Project	File	Line	Suppression State
Error		Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Could not resolve reference to 'SQLitePCL.delegate_progress_handler' (defined in assembly 'SQLitePCLRaw.provider.sqlcipher, Version=1.1.14.520, Culture=neutral, PublicKeyToken=7bbc99275c710061') 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(FieldDefinition field)
   at Mono.Linker.Steps.MarkStep.MarkEntireType(TypeDefinition type)
   at Mono.Linker.Steps.MarkStep.MarkEntireAssembly(AssemblyDefinition assembly)
   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) in /Users/builder/azdo/_work/451/s/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Diagnostics/Java.Interop.Tools.Diagnostics/Diagnostic.cs:line 166
   at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
   at Xamarin.Android.Tasks.LinkAssemblies.RunTask()
   at Xamarin.Android.Tasks.AndroidTask.Execute()	eKreta.Teacher.Mobile.Android	C:\Program Files (x86)\Microsoft Visual Studio 2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets	366	

I tried to add LinkSkip
<AndroidLinkSkip>SQLitePCLRaw.provider.sqlcipher;SQLitePCLRaw.provider.sqlcipher.android;SQLitePCLRaw.core</AndroidLinkSkip>
Does not help.

These are the nuget packages of the solution.

nuget

What could cause this issue?

@ericsink
Copy link
Owner

ericsink commented Dec 7, 2020

Not sure if this is the problem, but you have a mixture of SQLitePCLRaw 1.x and 2.x packages, which will definitely cause problems of some kind.

@zoli13
Copy link
Author

zoli13 commented Dec 8, 2020

Thanks. And later I also found your other suggestion:

SQLitePCLRaw 2.x is compatible with sqlite-net-pcl 1.7.
SQLitePCLRaw 1.x is compatible with sqlite-net-pcl 1.6.

So I downgraded all, and with this combination, it works fine (highlighted the changes)

nuget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants