2017-07-31 98 views
3

我試圖做我的團隊服務Xamarin.Android應用程序的發佈版本,並已得到了以下錯誤:Xamarin LinkAssemblies建立失敗

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 
'Microsoft.Azure.Mobile.Client, Version=4.0.1.0, Culture=neutral, 
PublicKeyToken=31bf3856ad364e35') 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(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() 
at Mono.Linker.Steps.MarkStep.Process() 
at Mono.Linker.Steps.MarkStep.Process(LinkContext context) 
at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context) 
at Mono.Linker.Pipeline.Process(LinkContext context) 
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, 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.<ExecuteInstantiatedTask>d__26.MoveNext() 

我可以看到,它可能涉及到包Microsoft.Azure.Mobile.Client但不知道我需要做些什麼來解決它(我對Xamarin很陌生,所以不知道該怎麼處理這些信息)。

我的minSdkVersion是21

感謝

+0

您能否提供詳細的步驟來重現問題? –

+0

如果不知道設置的詳細信息,很難確定,但聽起來您可能會錯過依賴關係,[Custom Tabs](https://www.nuget.org/packages/Xamarin.Android.Support.CustomTabs) /)包。 –

回答

2

它看起來像Microsoft.Azure.Mobile.Client包的傢伙有Android.Support.CustomTabs庫的問題。請參閱github上發佈的問題:Issue 364Issue 361。它看起來像Microsoft.Azure.Mobile.Client版本4.0.0可以針對Android.Support.CustomTabs版本25.3.1構建,但Microsoft.Azure.Mobile.Client版本4.0.1可以針對Android.Support.CustomTabs版本構建23.3.0。

在我的情況下,將nuget包Microsoft.Azure.Mobile.Client從4.0.1版降級到4.0.0版有助於構建和鏈接我的項目。