错误
我正在构建一个Xamarin.Form项目,当这个错误出现时,我正在编译Android项目,这很讽刺,因为这是一个与IOS相关的错误。
我做了什么
前一天晚上天气很好。今天早上,我将VS升级到16.11.1。然后我整理了这些项目。当我编译我的Android项目时,会出现这个错误。编译其他项目(例如表单项目)工作良好。
我所做的
我在互联网上搜索过解决方案(大多数解决方案都是旧的,但我还是试过了)。我已完成以下操作:
-
重新启动了我的计算机
-
关闭VS Studio,删除所有项目中的obj、bin和.VS文件夹,并重新启动Visual Studio
-
清除了重新下载的nuget包并重新编译。
-
升级到最新版本的Xamarin和所有最新的nuget软件包
-
通过github(gitclone)恢复了我以前的项目(从昨晚开始),并尝试编译。
以上都不起作用
参考文献
这是粘贴的完整错误副本=>
Severity Code Description Project File Line Suppression State
Error XALNS7028: System.IO.FileNotFoundException: Could not load assembly 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Xamarin.iOS.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters) in /Users/builder/azdo/_work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:line 221
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference) in /Users/builder/azdo/_work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:line 191
at Mono.Cecil.MetadataResolver.Resolve(TypeReference type) in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/cecil/Mono.Cecil/MetadataResolver.cs:line 110
at Mono.Cecil.TypeReference.Resolve() in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/cecil/Mono.Cecil/TypeReference.cs:line 276
at Java.Interop.Tools.Cecil.TypeDefinitionCache.Resolve(TypeReference typeReference) in /Users/builder/azdo/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/TypeDefinitionCache.cs:line 20
at Java.Interop.Tools.Cecil.TypeDefinitionRocks.<GetTypeAndBaseTypes>d_5.MoveNext() in /Users/builder/azdo/_work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/TypeDefinitionRocks.cs:line 40
at Java.Interop.Tools.Cecil.TypeDefinitionRocks.IsSubclassOf(TypeDefinition type, String typeName, IMetadataResolver resolver) in /Users/builder/azdo/_work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/TypeDefinitionRocks.cs:line 94
at MonoDroid.Tuner.FixAbstractMethodsStep.FixAbstractMethodsUnconditional(AssemblyDefinition assembly)
at Xamarin.Android.Tasks.LinkAssembliesNoShrink.RunTask()
at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/builder/azdo/_work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17 0