Application-specific directories are erased when deploying android application

André Lamothe 0 Reputation points
2023-05-01T14:04:16.45+00:00

My environment :

Visual Studio Community 2022 Version 17.5.4 and Xamarin 17.5 (Xamarin.android SDK 13.2)

Target platform android 12.1 (Samsung phone)

When I deploy a project to my phone via USB connection, application specific directories are sometimes erased.

This application-specific directories erased are documents directories ContextWrapper.GetExternalFilesDirs(null)[0 or 1].AbsolutePath, ie

  • /storage/0123-4567/Android/data/Myapp/files
  • /storage/emulated/0/Android/data/Myapp/files.

Sometimes only files are erased, sometimes directories cache and files are itself erased (I don't use others specific directories).

I am an occasional user of Xamarin. I had never encountered this problem before.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,349 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,109 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.