Error Failed to complete ResolveLibraryProjectImports task

I get and am mistaken when trying to compile an Android project in VS2017 with Xamarin. I was getting a string like an invalid error, and one of the suggestions was updating all of my Xamarin.Android links. I found one that was observable for Xamarin.Core, so I installed it. Every time since then I get a permission error. I tried to remove the obj and bin directories and restart vs and my laptop.

Here is the error text

Error Failed to complete the ResolveLibraryProjectImports task. System.IO.PathTooLongException: The specified path, file name, or both are too long. A fully qualified file name must be less than 260 characters, and a directory name> must be less than 248 characters. in System.IO.PathHelper.GetFullPathName () in System.IO.Path.LegacyNormalizePath (String path, Boolean fullCheck, Int32> maxPathLength, Boolean expandShortPaths) in System.IO.Path.NormalizePath (String path, Booleanth fullCheCenthp> , Boolean expandShortPaths) in System.IO.Path.NormalizePath (String path, Boolean fullCheck, Int32> maxPathLength) in System.IO.FileStream.Init (String path, FileMode mode, FileAccess access,> Int32 rights, Boolean useRights, share FileShare, Int32 bufferSize,> Parameters FileOptions, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean> bFromProxy, Boolean useLongPath, Boolean checkHost) in System.IO.FileStream..ctor (String path, FileMode mode, FileAccess>, fileShare sharing) System.IO.File.Open (String path, FileMode mode) on Xamarin.Tools.Zip.ZipEntry.DoExtract (IntPtr zipFile, String> destinationPath, FileMode outputFileMode, EntryExtractEventArgs a rgs) on Xamarin.Tools.Zip.ZipEntry.Extract (String destinationDir, String> destinationFileName, FileMode outputFileMode) on Xamarin.Android.Tools.Files.ExtractAll (ZipArchive zip, String> destination, Action 2 progressCallback) at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract (DirectoryAssemblyResolver res, ICollection 1 jars, ICollection 1 >resolvedResourceDirectories, ICollection ICollection 1 resolAssetDirectories,> ICollection`1 resolvedEnvironments) on Xamarin.Android.Tasks.ResolveLibraryBecject.jects. Microsoft.Build.BackEnd.ITaskExecutio> nHost.Execute () at> Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext () LayoutExample.Android

+5
source share
5 answers

https://forums.xamarin.com/discussion/92979/error-the-resolvelibraryprojectimports-task-failed-unexpectedly

Here is the problem: System.IO.PathTooLongException: The specified path, file name, or both are too large. A fully qualified file name must be less than 260 characters, and a directory name must be less than 248 characters.

Try moving the project to another location, for example "C: /", or change the name of the project to something shorter

+5
source

solution edits your Android project file (csproj) as shown below

enter image description here

https://github.com/xamarin/AndroidSupportComponents/issues/51

+3
source

I just answered another SO question ( fooobar.com/questions/419671 / ... ).

Its essence is that if your solution is saved in a place with a long path, this may lead to the fact that some files will have a path that exceeds the maximum for Windows (260 characters)

Try moving the solution to the root of your C or D (if you have one).

0
source

There was the same problem. This is how I fixed it.

  • Restart Visual Studio
  • Open project
  • Clear solution
  • Restore solution
  • Close Solution
  • Reopen the project
0
source

I got this when I added a link to Xamarin.GooglePlayServices.Ads to my project through NuGet. As soon as I did this, I got the same problem as the OP. Moving my code to the root directory of my C drive did not help either; however, at the suggestion of Alper Ebikoglu, I added ...

 <UseShortFileNames>True</UseShortFileNames> 

... to my project file in the property group for my build configurations. After reloading the project in Visual Studio, I was able to create the project.

Hope this helps!

0
source

Source: https://habr.com/ru/post/1268367/


All Articles