2017-07-31 101 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版有助于构建和链接我的项目。