The "ResolveLibraryProjectImports" task failed unexpectedly
Solution 1
I've literally just had this with a brand new Xamarin.Forms application in Visual Studio 2017.
The root cause appears to be that I let VS2017 create the project in it's default location 'C:\Users\Dave\Documents\Visual Studio 2017\Projects' and this has resulted in one of more files now having a path which it too long.
I moved the solution to the root of my D drive and it builds without any problem.
Solution 2
Your issue is most likely linked to this post on the Xamarin forums, and this bugzilla entry. Without a reproducible sample, all I can advise you try is:
- Updating Xamarin for Visual Studio, Xamarin.Android, and Xamarin.iOS to the latest stable versions
- Cleaning and rebuilding
- Deleting all of the
bin
andobj
folders from your project directories - Restarting Visual Studio/your PC
Failing all of that, there's not likely to be anyone who can help you without a reproducible sample and potentially your Xamarin logs.
Solution 3
edit your android project file (csproj) like below
this issue topic may guide https://github.com/xamarin/AndroidSupportComponents/issues/51
Solution 4
Had same problem. Here is my solution
- Restart Visual Studio
- Open the Project
- Clean the solution
- Rebuild the solution
- Close solution
- Reopen the project
Solution 5
Well for me the problem was in my xaml file...
Somehow while setting the Layout bounds i used '.' as a separator instead of ','
e.g
AbsoluteLayout.LayoutBounds="0.5.0.3,1,0.3"
should have been AbsoluteLayout.LayoutBounds="0.5,0.3,1,0.3"
Hence changing the '.' to ',' solved the problem
Comments
-
Zaeem Sattar about 3 years
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.
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.