我试图使用链接器来降低我的Apk尺寸,但我不知道为什么当我尝试存档发布在VS17中的应用时它会拒绝以下内容错误:
我需要一些帮助。
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(5,5): Error MSB4018: The "LinkAssemblies" task failed unexpectedly.
Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Could not resolve reference to 'System.Void Xamarin.Forms.Xaml.XamlFilePathAttribute::.ctor(System.String)' (defined in assembly 'diabetics_app, Version=1.0.6491.28672, Culture=neutral, PublicKeyToken=null') with scope 'Xamarin.Forms.Xaml, 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.Xaml.XamlFilePathAttribute::.ctor(System.String)
at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod (Mono.Cecil.MethodReference reference) [0x00006] in <7f8f41ce59254afda8c887041bd5a240>:0
at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference) [0x00049] in <7f8f41ce59254afda8c887041bd5a240>:0
at Mono.Linker.Steps.MarkStep.MarkCustomAttribute (Mono.Cecil.CustomAttribute ca) [0x00013] in <7f8f41ce59254afda8c887041bd5a240>:0
at Mono.Linker.Steps.MarkStep.MarkCustomAttributes (Mono.Cecil.ICustomAttributeProvider provider) [0x0001f] in <7f8f41ce59254afda8c887041bd5a240>:0
at Mono.Linker.Steps.MarkStep.MarkType (Mono.Cecil.TypeReference reference) [0x00069] in <7f8f41ce59254afda8c887041bd5a240>:0
at MonoDroid.Tuner.MonoDroidMarkStep.MarkType (Mono.Cecil.TypeReference reference) [0x00000] in <7f8f41ce59254afda8c887041bd5a240>:0
at Mono.Linker.Steps.MarkStep.InitializeType (Mono.Cecil.TypeDefinition type) [0x0004d] in <7f8f41ce59254afda8c887041bd5a240>:0
at Mono.Linker.Steps.MarkStep.InitializeAssembly (Mono.Cecil.AssemblyDefinition assembly) [0x00022] in <7f8f41ce59254afda8c887041bd5a240>:0
at Mono.Linker.Steps.MarkStep.Initialize () [0x00014] in <7f8f41ce59254afda8c887041bd5a240>:0
at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x00007] in <7f8f41ce59254afda8c887041bd5a240>:0
at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00020] in <7f8f41ce59254afda8c887041bd5a240>:0
at MonoDroid.Tuner.Linker.Run (Mono.Linker.Pipeline pipeline, Mono.Linker.LinkContext context) [0x00000] in <7f8f41ce59254afda8c887041bd5a240>:0
at MonoDroid.Tuner.Linker.Process (MonoDroid.Tuner.LinkerOptions options, Mono.Linker.LinkContext& context) [0x00070] in <7f8f41ce59254afda8c887041bd5a240>:0
at Xamarin.Android.Tasks.LinkAssemblies.Execute (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res) [0x002c8] in <7f8f41ce59254afda8c887041bd5a240>:0
--- End of inner exception stack trace ---
at Java.Interop.Tools.Diagnostics.Diagnostic.Error (System.Int32 code, System.Exception innerException, System.String message, System.Object[] args) [0x00000] in /Users/builder/data/lanes/4986/28510831/source/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Diagnostics/Java.Interop.Tools.Diagnostics/Diagnostic.cs:163
at Xamarin.Android.Tasks.LinkAssemblies.Execute (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res) [0x0046e] in <7f8f41ce59254afda8c887041bd5a240>:0
at Xamarin.Android.Tasks.LinkAssemblies.Execute () [0x00205] in <7f8f41ce59254afda8c887041bd5a240>:0
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/msbuild-15.3/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:631
at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__26.MoveNext () [0x00249] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/msbuild-15.3/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:787 (MSB4018) (diabetics_app.Droid)