Error: The specified path, file name, or both are too long. The fully qualified file name must be le

VarunRVarunR USUniversity ✭✭

I have installed the VS 2015 and getting this error after the Xamarin update.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error: 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.
I tried to run the solution in xamarin studio - It also fails with the same error.

Posts

  • kentuckerkentucker USMember ✭✭✭✭✭

    You need to move the root of the project to a shorter path. For example by default the projects are created in c:\users[user name\documents\visual studio 2015\projects. If you create the project in c:\MyProjects you wont get that error.

    If you have the win 10 Anniversary edition you can try enabling long file names.

    https://csharp2ae.blogspot.com/2016/08/how-to-enable-long-file-names-in.html

  • VarunRVarunR USUniversity ✭✭

    The path specified is one level in c:-> say c:\Test. The error doesn't go away. I'm using win7. Recently this problem started and it doesn't go away.

  • marxxliveatmarxxliveat USMember

    Having the same problem here. The Problem is not related to the location where our source code lives, but related to, where Xamarin gets it's support librarys from. This path is by default pointing to the User Profil (for some reason).

    I was describing the case also in my post here:
    https://forums.xamarin.com/discussion/83132/path-too-long-during-build-how-to-change-directory-for-xamarin-android

    but didn't get an answer yet.

  • marxxliveatmarxxliveat USMember

    @kentucker said:
    You need to move the root of the project to a shorter path. For example by default the projects are created in c:\users[user name\documents\visual studio 2015\projects. If you create the project in c:\MyProjects you wont get that error.

    If you have the win 10 Anniversary edition you can try enabling long file names.

    https://csharp2ae.blogspot.com/2016/08/how-to-enable-long-file-names-in.html

    Thanks Ken, your Post pointed me to a stable fix for the issue!

    Also found this guide here to activate long paths in Win10 Anniversary:
    http://winaero.com/blog/how-to-enable-ntfs-long-paths-in-windows-10/

    After restarting the machine i had to manually download the package stated in the error message and expand it to the right location in the user profile (also stated in the error message).
    From then on it was working again.

  • marxxliveatmarxxliveat USMember

    @kentucker said:
    You need to move the root of the project to a shorter path. For example by default the projects are created in c:\users[user name\documents\visual studio 2015\projects. If you create the project in c:\MyProjects you wont get that error.

    If you have the win 10 Anniversary edition you can try enabling long file names.

    https://csharp2ae.blogspot.com/2016/08/how-to-enable-long-file-names-in.html

    Thanks Ken, your Post pointed me to a stable fix for the issue!

    Also found this guide here to activate long paths in Win10 Anniversary:
    http://winaero.com/blog/how-to-enable-ntfs-long-paths-in-windows-10/

    After restarting the machine i had to manually download the package stated in the error message and expand it to the right location in the user profile (also stated in the error message).
    From then on it was working again.

  • WatsonWoodWatsonWood USMember

    If you are getting error saying path or file name are both too long, I highly recommend for you to use Long Path Tool Software. It is very easy to use and it will really fix the problem on this one and if you encounter it again in the future you'll know what to use.

Sign In or Register to comment.