2017-03-05 71 views
0

我的应用工作在调试模式很好,但如果我想建立它在释放我得到以下错误:广东话构建我的应用程序在发布模式

Fehler 1 Unerwarteter Fehler bei der LinkAssemblies-Aufgabe. 
Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Could not resolve reference to 'System.Void Xamarin.Forms.Element::set_AutomationId(System.String)' (defined in assembly 'ZXing.Net.Mobile.Forms, Version=2.1.47.0, Culture=neutral, PublicKeyToken=null') with scope 'Xamarin.Forms.Core, Version=2.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 Xamarin.Forms.Element::set_AutomationId(System.String) 
    bei Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference) 
    bei Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction) 
    bei Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body) 
    bei Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method) 
    bei Mono.Linker.Steps.MarkStep.ProcessQueue() 
    bei Mono.Linker.Steps.MarkStep.Process() 
    bei Mono.Linker.Steps.MarkStep.Process(LinkContext context) 
    bei MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context) 
    bei Mono.Linker.Pipeline.Process(LinkContext context) 
    bei MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context) 
    bei Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res) 
    --- Ende der internen Ausnahmestapelüberwachung --- 
    bei Java.Interop.Tools.Diagnostics.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args) 
    bei Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res) 
    bei Xamarin.Android.Tasks.LinkAssemblies.Execute() 
    bei Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() 
    bei Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() Euroscola_App1 

这个问题的存在,因为在今天,我不知道原因是我下载了一个更新的Xamarin版本,或者因为我已经安装了ZXing软件包。

+0

问题是否仍然存在,如果你删除斑马线? –

回答

0

When the scope is different from the defining assembly, it usually means that the type is forwarded.

您的Xamarin.Android应用项目启用链接器的应用程序并没有在Xamarin.FormsZXing.Net.Mobile.Forms转发类型之间的版本不匹配。基本上ZXing.Net.Mobile.Forms是针对较早版本的Forms编译的,那么您当前正在使用您的项目,并且如果程序集包含C#扩展,则是一个非常常见的问题。

两个选项,关闭连接整个应用程序或禁用链接只是以及Zing组件:

要禁用链接只是一个组件,编辑您的Android应用程序项目(.csproj),并添加以下< AndroidLinkSkip>

<PropertyGroup> 
    <AndroidLinkSkip>ZXing.Net.Mobile.Forms</AndroidLinkSkip> 
</PropertyGroup> 

编号:Xamarin的Android链接:AndroidLinkSkip