“ResolveLibraryProjectImports"任务意外失败 [英] The "ResolveLibraryProjectImports" task failed unexpectedly

查看:36
本文介绍了“ResolveLibraryProjectImports"任务意外失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于 MvvmCross 的 Xamarin 项目.该项目适用于 iOS 和 Android.我在 Visual Studio 15 中打开了这个项目.我遇到了一些错误,我很快就解决了.有一些错误被卡住了,即使在谷歌和 Stackoverflow 上搜索后我也无法解决它们.我已经尝试了在 Stackoverflow 上找到的每一种方法,但仍然存在所有剩余的错误.这个项目使用了 3rd 方库,如 RestSharp 和 BoxApi.V2(更多)

I have a Xamarin project, which is based on MvvmCross. The project is for both iOS and Android. I opened this project in Visual Studio 15. I got some errors, which I solved in no time. There are some errors, which are stuck and I couldn't solve them even after searching on Google and on Stackoverflow. I have tried each and every method found on Stackoverflow, but still all remaining errors are there. This project is using 3rd party libraries like RestSharp and BoxApi.V2 (few more)

我在下面发布了我的错误日志.

I am posting my error log below.

Severity    Code    Description Project File    Line    Suppression State
Error       The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'RestSharp(Android), Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'RestSharp(Android).dll'
   at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
   at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName, ReaderParameters parameters)
   at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName)
   at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.GetAssembly(String fileName)
   at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(DirectoryAssemblyResolver res, ICollection`1 jars, ICollection`1 resolvedResourceDirectories, ICollection`1 resolvedAssetDirectories, ICollection`1 resolvedEnvironments)
   at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() BoxApi.V2 (Android)

此解决方案中包含的所有项目都会重复出现此错误.所以我多次收到此错误.

This error is repeating for all projects included in this solution. So I am getting this error multiple times.

我还想补充一点,该项目以前是在 MAC 上构建的,而我使用的是 Windows,这是否会产生一些兼容性或跨操作系统问题?我已经检查了所有程序集参考并且一切正常.

I also want to add that the project was previously built on MAC and I am using windows, does this make some compatibility or cross OS issue? I have checked all assembly references and all are working fine.

推荐答案

我确实刚刚在 Visual Studio 2017 中使用全新的 Xamarin.Forms 应用程序实现了这一点.

I've literally just had this with a brand new Xamarin.Forms application in Visual Studio 2017.

根本原因似乎是我让 VS2017 在其默认位置C:UsersDaveDocumentsVisual Studio 2017Projects"中创建项目,这导致多个文件之一现在具有路径太长了.

The root cause appears to be that I let VS2017 create the project in it's default location 'C:UsersDaveDocumentsVisual Studio 2017Projects' and this has resulted in one of more files now having a path which it too long.

我将解决方案移至 D 驱动器的根目录,它构建没有任何问题.

I moved the solution to the root of my D drive and it builds without any problem.

这篇关于“ResolveLibraryProjectImports"任务意外失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆