android-“ CheckDuplicateJavaLibraries”任务意外失败

我正在尝试构建我的应用程序,但弹出以下错误.几天前,我在构建它时没有任何问题.

Error       The "CheckDuplicateJavaLibraries" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file 'obj\Debug\__library_projects__\VectorCompat\library_project_imports\bin\classes.jar'.
File name: 'obj\Debug\__library_projects__\VectorCompat\library_project_imports\bin\classes.jar'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileInfo.get_Length()
at Xamarin.Android.Tasks.MonoAndroidHelper.SizeAndContentFileComparer.GetHashCode(FileInfo obj)
at System.Linq.Set`1.InternalGetHashCode(TElement value)
at System.Linq.Set`1.Find(TElement value, Boolean add)
at System.Linq.Enumerable.<DistinctIterator>d__63`1.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Xamarin.Android.Tasks.MonoAndroidHelper.DistinctFilesByContent(IEnumerable`1 filePaths)
at Xamarin.Android.Tasks.CheckDuplicateJavaLibraries.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()    TotemAndroid            

是否应该删除VectorCompat组件并再次添加?为什么几天前构建良好就突然出现此错误?

提前致谢.

解决方法:

似乎某些文物没有复制到您的obj文件夹中,即VectorCompat的classes.jar.我建议手动删除obj文件夹并重建解决方案.

上一篇:c#-Xamarin在Android / iOS上通用的Xamarin.Forms代码


下一篇:如何在Xamarin中获取GoogleApiClient实例?