Xamarin.Android Linker Error (Plugins.Share)

raveroravero USMember ✭✭

Trying to build a Xamarin.Android project in release mode, with Like SDK assemblies only enabled is producing the following error:

    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(5,5): Error MSB4018: The "LinkAssemblies" task failed unexpectedly.
Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Could not resolve reference to 'System.Void Android.Support.CustomTabs.CustomTabsIntent::LaunchUrl(Android.App.Activity,Android.Net.Uri)' (defined in assembly 'Plugin.Share, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null') with scope 'Xamarin.Android.Support.CustomTabs, Version=1.0.0.0, 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 System.Void Android.Support.CustomTabs.CustomTabsIntent::LaunchUrl(Android.App.Activity,Android.Net.Uri)
    at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference) [0x0006e] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/external/linker/linker/Mono.Linker.Steps/MarkStep.cs:963 
    at Mono.Linker.Steps.MarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction) [0x00048] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/external/linker/linker/Mono.Linker.Steps/MarkStep.cs:1183 
    at Mono.Linker.Steps.MarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x000a5] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/external/linker/linker/Mono.Linker.Steps/MarkStep.cs:1173 
    at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00191] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/external/linker/linker/Mono.Linker.Steps/MarkStep.cs:1052 
    at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00022] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/external/linker/linker/Mono.Linker.Steps/MarkStep.cs:156 
    at Mono.Linker.Steps.MarkStep.Process () [0x00019] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/external/linker/linker/Mono.Linker.Steps/MarkStep.cs:115 
    at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x0000f] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/external/linker/linker/Mono.Linker.Steps/MarkStep.cs:60 
    at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00023] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/external/linker/linker/Mono.Linker/Pipeline.cs:118 
    at MonoDroid.Tuner.Linker.Run (Mono.Linker.Pipeline pipeline, Mono.Linker.LinkContext context) [0x00001] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/Linker.cs:34 
    at MonoDroid.Tuner.Linker.Process (MonoDroid.Tuner.LinkerOptions options, Mono.Linker.LinkContext& context) [0x0007b] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/Linker.cs:29 
    at Xamarin.Android.Tasks.LinkAssemblies.Execute (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res) [0x002ff] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/LinkAssemblies.cs:145 
    --- End of inner exception stack trace ---
    at Java.Interop.Tools.Diagnostics.Diagnostic.Error (System.Int32 code, System.Exception innerException, System.String message, System.Object[] args) [0x00001] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Diagnostics/Java.Interop.Tools.Diagnostics/Diagnostic.cs:163 
    at Xamarin.Android.Tasks.LinkAssemblies.Execute (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res) [0x004a0] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/LinkAssemblies.cs:185 
    at Xamarin.Android.Tasks.LinkAssemblies.Execute () [0x0022f] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/LinkAssemblies.cs:92 
    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/msbuild-15.0/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:632 
    at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__26.MoveNext () [0x00249] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/msbuild-15.0/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:787  (MSB4018) (Clikmotors.Droid)

Configuration:

  • macOS Sierra 10.12.5
  • Visual Studio for Mac 7.0.1 (build 24)
  • Xamarin.Android 7.3.1.2
  • Project Target SDK: API 25 (Nougat 7.1)

The Android SDK's area all up to date:
enter image description here

As is the compilers and repositories:
enter image description here

I've also tried to ignore the Plugin.Share assembly in the project configurations. None of this worked, the only way I could compile the app was by disabling linking.

Answers

Sign In or Register to comment.