2017-03-05 69 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