CrossGeeks / GeofencePlugin

Geofence Plugin for Xamarin iOS and Android
MIT License
48 stars 22 forks source link

Android - Linking error: The "LinkAssemblies" task failed unexpectedly #9

Closed victordscott closed 4 years ago

victordscott commented 5 years ago

When I attempt to build an Android release version with Linking set to "Sdk Assemblies Only", I get the following error:

The "LinkAssemblies" task failed unexpectedly. Mono.Linker.MarkException: Error processing method: 'System.Void Plugin.Geofence.GeofenceImplementation::InitializeGoogleAPI()' in assembly: 'Plugin.Geofence.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Int32 Android.Gms.Common.Zzc::IsGooglePlayServicesAvailable(Android.Content.Context) at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference) at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference) at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction) at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body) at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method) at Mono.Linker.Steps.MarkStep.ProcessQueue() --- End of inner exception stack trace --- at Mono.Linker.Steps.MarkStep.ProcessQueue() at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue() at Mono.Linker.Steps.MarkStep.Process() at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context) 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) at Xamarin.Android.Tasks.LinkAssemblies.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() WorkforcePoint.Droid

I am not sure if this is related to the plugin or its dependencies? Any help will be appreciated.

victordscott commented 5 years ago

It seems that this may be caused by referencing a different version of the GooglePlayServices packages in your solution than what is referenced in the Plugin.Geofence Android project. I was able to resolve this for now by: