resolve xamarin android "path too long" without relocation

I faced the same Issue before, here is what I have found :

Windows has a Maximum Path Length Limitation. You could see it in Windows Naming Files, Paths, and Namespaces :

Maximum Path Length Limitation In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:\some 256-character path string" where "" represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.) This is the reason why you have the issue.

You could shorten the directory path to your project to solve this problem, another solution is use the long path tool. But as PierceBoggan said :

the easiest way to avoid this issue is to move your source to the C:/ drive (or another location with fewer characters in the path).


Update :

The issue was fixed in Xamarin.Android 8.0.2.1, and this version is included in the Visual Studio 2017 version 15.4.2 release. You could read this document :

https://developer.xamarin.com/releases/android/xamarin.android_8/xamarin.android_8.0/#Issues_Fixed


I faced this issue too. Updating VS 2017 to 15.4.0 fixed it for me. Moving it closer to C:\ didn't change anything.


I had this problem even when moving my project to root of drive. However after updating Visual Studio to the newest version(15.7.0) the option to change archive output directory has been added to IDE:

Tools --> Options--> Android Settings : Archives Location

enter image description here

By setting this location to a directory as close to drive root as possible(such as D:\Archives), this error will go away.