HELP BUILDING A Xamarin CrossPlatform Project for Android

Category: visual studio msbuild


Alfonso Neil Félix López on Wed, 16 Jan 2019 21:07:46

I recently started to develop in Xamarin, so I don't know how to fix this kind of errors, I'll be glad for receive any help. Thanks

This is the error:

Severity    Code    Description    Project    Project Rank    File    Line    Suppression State
Error        The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
   at System.IO.PathHelper.GetFullPathName()
   at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.GetFullPathInternal(String path)
   at Xamarin.Android.Tools.Files.ExtractAll(ZipArchive zip, String destination, Action`2 progressCallback, Func`2 modifyCallback, Func`2 deleteCallback, Boolean forceUpdate)
   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()    GuasaveDigitalApp.Android    1            


Lance Li-MSFT on Thu, 17 Jan 2019 03:21:52

Hi friend ,

Welcome to MSDN forum.

I can’t reproduce this issue at my side with Xamarin for android (.net framework, vs2017,win10 1803).

And the exception seems to indicate too long name in your directionIf convenient, please move your solution to C: root directory, open the .sln using VS IDE and rebuild it to check if it helps.

If that not works, please share the entire error message so that we can check it directly for you.  

In addition: If this issue results from too long name and moving to C root directory solves it , you may get help from this doc if you don’t like to move solution to C root dir.

Hope info above can help. Looking forward to your reply.

Best regards.