3

I'm trying to build a distribution-ready apk (following this guide) for a project I've been working on recently using Xamarin.Forms and Visual Studio 2019. However, i can't get past the Archiving Stage because i keep getting below error as stated by Visual Studio itself:

Cannot create the archive file because the copy of mdbs files failed.
Could not find a part of the path ...

enter image description here

Its worth noting that i have not changed anything yet on the project properties and the solution is stored on a relatively short path of D:\Repository\QR Code Attendance. If i am to guess, this is an issue with PATH limited to 255 characters? If so, how would i be able to overcome it?

Just copying the apk from the \Debug Folder and installing it on a Android Phone doesn't work. The app just closes as soon as it starts.

adamm
  • 849
  • 1
  • 6
  • 17
Nii
  • 450
  • 6
  • 25

1 Answers1

3

The Archives are not in the solution folder. Your Archives folder is in C:/User/Administrator/App Data/Local/Xamarin/Mono for Android/Archives. You shoud change it to something shorter, like C:/Archives. This can be done in Tools -> Options -> Xamarin -> Android Settings -> Archives Location.

adamm
  • 849
  • 1
  • 6
  • 17
  • thank you sir, that fixed my rather simple problem. – Nii Apr 20 '21 at 06:22
  • 2
    Just don't make the same mistake as me: I typed in 'C:\Archives\Android' as the path and hit OK with the confident assumption that it would create the directory. __It does not__. When archiving failed again, I reopened the tool only to find the reverted original path. I recommend using the browse button to set the new path! – IVSoftware Aug 31 '21 at 17:19