Application-specific directories are erased when deploying android application

André Lamothe 0 Reputation points

My environment :

Visual Studio Community 2022 Version 17.5.4 and Xamarin 17.5 ( 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.

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