c# - Java.Interop.Tools.Diagnostics.XamarinAndroidException : error XA2006

标签 c# msbuild xamarin.android xamarin.forms syncfusion

我正在尝试发布 Xamarin.Forms 应用程序,但是当我在 Android 项目的配置中更改为发布并构建时,出现以下错误:

Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Could not resolve reference to 'System.Int32 Xamarin.Forms.Platform.Resource/String::ApplicationName' (defined in assembly 'Syncfusion.SfChart.XForms.Android, Version=13.2451.0.29, Culture=neutral, PublicKeyToken=null') with scope 'Xamarin.Forms.Platform, 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.Int32 Xamarin.Forms.Platform.Resource/String::ApplicationName
       at Mono.Linker.Steps.MarkStep.MarkField(FieldReference 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() XamarinCRM.Android      

最佳答案

我也出现了同样的错误信息。我能够像这样解决它: 右键单击 Android Project > Properties > Android Options > Linker,然后在 Linking 属性中选择“None”选项。

关于c# - Java.Interop.Tools.Diagnostics.XamarinAndroidException : error XA2006,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43621532/

相关文章:

c# - Xamarin.Android 中的位图旋转

.net - Xamarin Android 辅助服务泄漏内存

c# - 将内存映射与服务一起使用

msbuild - XmlPeek 空字符串导致失败

c++ - try-catch block 可以在 LLVM/MSVC 上编译吗?

c# - PackageReference 未将 dll 复制到使用者(测试)项目输出,ExcludeAssets = "runtime"且 PrivateAssets = "none"

android - 如何将 Firebase 消息传送到 Xamarin.Android 应用程序?

C# 限制线程 CPU 使用率

c# - Unity - 如何旋转和全屏视频,在 RawImage 上使用 VideoPlayer API 播放

c# - JavaScript 中使用无符号 32 位整数进行位移/类型转换?