Oregon39-5606 avatar image
0 Votes"
Oregon39-5606 asked Oregon39-5606 commented

Xamarin Forms Android Linker Error

Hello, I'm working on an Xamarin Forms Android release. It only seems to work for me with the Linker property set to 'None,' but that causes a target invocation error for me with the Prism NavigationAsync method. If I use 'SDK and User Assemblies' for the Linker property I get the following error:

Severity Code Description Project File Line Suppression State
Error Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Could not resolve reference to 'Firebase.Iid.FirebaseInstanceIdService' (defined in assembly 'Microsoft.AppCenter.Push, Version=, Culture=neutral, PublicKeyToken=null') with scope 'Xamarin.Firebase.Iid, Version=, Culture=neutral, PublicKeyToken=null'. When the scope is different from the defining assembly, it usually means that the type is forwarded. ---> Mono.Cecil.ResolutionException: Failed to resolve Firebase.Iid.FirebaseInstanceIdService
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.MarkType(TypeReference reference)
at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
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 Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.RunTask()
at Xamarin.Android.Tasks.AndroidTask.Execute() JCX.Android

I've tried upgrading or removing packages as well as different configuration settings, but I still get this error.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I found a similar thread based on your description:

Others migrate to Azure Notification Hubs, this issue is disappear.

1 Vote 1 ·

@LeonLu-MSFT Thanks for your response. I came across that as well. Can I just uninstall App Center Push and install the Azure Notification Hubs and implement the notifications or do we also need to get a subscription in Azure for that? It appears to me that we would need to subsribe to that in Azure. Is that right?

0 Votes 0 ·

@LeonLu-MSFT I see that there is all the required info on the Azure Notification Hubs page for getting started. Thanks again!

0 Votes 0 ·

0 Answers