Forum Visual Studio

Xamarin Archive Manager fails with: The specified path, file name, or both are too long

FredrikFredrik SEMember ✭✭

When I try to create an archive from Visual Studio to distribute my Xamarin Android App, the Archive Manager fails with the message:
"Failed to create App archive 'MyCompanyName.Client.Droid'. 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."

This only happens in Release build mode, not in Debug.

Is there a way to change the archive folder path and make it shorter?
The Archive Manager does not tell which file or path is causing the problem.

(I've tried the Windows 10 registry and gpedit.msc "enable long path" fix, but it did'nt help)

Please help!

Answers

  • rivamwrivamw INMember

    Please try using Long Path Tool

  • FredrikFredrik SEMember ✭✭

    Thank you for answering!
    I got Long Path Tool, but what do I do with it?

  • extremeandyextremeandy ITMember

    Today I encountered the same problem compiling the package is up and running again after deleting all of the items contained in the folder: C:\Users\Administrator\AppData\Local\Xamarin\Mono for Android\Archives
    I hope it help you
    Andy

  • FredrikFredrik SEMember ✭✭

    Deleting all the files in the C:\Users\Administrator\AppData\Local\Xamarin\Mono for Android\Archives did'nt help in my case. =(

    But I found another strange workaround:
    If I compile and Archive, the Archive will fail. Then I Archive once more and it will also fail. But now it is possible to Distribute the last failed Archive!
    I have so far not found any problem at all with the distributed apk file. It runs without any problem and Google Play accepts it.

  • mubimubi USMember ✭✭✭

    above give solutions not working ??
    any quick workaround for this issue ?

  • frederik0203frederik0203 AFMember

    Hi, I also encountered this problem and only Long path tool worked for me . Try using it too.

  • prashantvcprashantvc USXamarin Team Xamurai

    Path too long is Windows limitation, Xamarin or Android tools have not control over it. Could you share all the text from output window and logs[1]?

    The quick fix would to move your project and Android SDK close to the root drive ex: c:\dev

    1. Help/Xamarin/Zip logs...
  • FelipeSouzaLongoFelipeSouzaLongo USMember ✭✭

    @rivamw said:
    Please try using Long Path Tool

    How to use that ?

  • FelipeSouzaLongoFelipeSouzaLongo USMember ✭✭

    The Archieve Manager keep using the same long path, even after i changed my visual studio solution path.

    Archieve Manager: C:\Users\Felipe\AppData\Local\Xamarin\Mono for Android\Archives\2017-10-01.....
    My App: C:_\MyApp

    Currently i simply cannot produce a valid apk to publish.

  • yinyueyinyue USMember

    @prashantvc said:
    Path too long is Windows limitation, Xamarin or Android tools have not control over it. Could you share all the text from output window and logs[1]?

    The quick fix would to move your project and Android SDK close to the root drive ex: c:\dev

    1. Help/Xamarin/Zip logs...

    The Archieve Manager keep using the same long path, even after I changed my visual studio solution path.
    Archieve Manager: C:\Users\username\AppData\Local\Xamarin\Mono for Android\Archives\2017-10-01.....

  • Phyti1Phyti1 Member

    I solved this issue by changing the archive path to something shorter:
    Under Tools -> Options -> Xamarin -> Android Settings -> Archives Location
    for iOS:
    Tools -> Options -> Xamarin -> iOS Settings -> Archives

    Scroll down and change the Archives path to something shorter like C:\Archives.
    You may also want to port your existing Archives to this folder.

Sign In or Register to comment.