Why am I getting this error in Xamarin.Forms using Visual Studio?

Bruce Krueger 331 Reputation points
2021-02-21T22:38:23.547+00:00

Severity Code Description Project File Line Suppression State Error XARDF7023: System.IO.DirectoryNotFoundException: Could not find a part of the path 'MediaSessionCompat_OnActiveChangeListenerImplementor.class'. at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data) at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost) at Xamarin.Android.Tasks.RemoveDirFixed.RunTask() 0

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,294 questions
{count} votes

Accepted answer
  1. Ahmad Uzair 81 Reputation points MVP
    2021-04-10T05:21:48.797+00:00

    I was banging my head around for quite a while and figured out that you cant have any spaces or special characters in the path to your project

    For example: C:/abc xyz/ProjectName/... is unacceptable because there is a space between abc and xyz.

    I don't exactly know why but this works for me

    Hope it helps!

    Happy coding!

    1 person found this answer helpful.

7 additional answers

Sort by: Most helpful
  1. Bruce Krueger 331 Reputation points
    2021-03-15T20:27:43.317+00:00

    Hoping LeonLu-MSFT can.


  2. Bruce Krueger 331 Reputation points
    2021-03-16T17:06:07.037+00:00

    That path is already in existence on my computer so apparently not the problem.
    I am currently trying a different solution with a short file path for the project to see if that fixes the problem.

    0 comments No comments

  3. Bruce Krueger 331 Reputation points
    2021-03-17T14:51:53.29+00:00

    I recreated this and other projects with a very short file path.
    I updated to Visual Studio 16.9.2

    I am not sure which of these two fixed the problem but I am successfully creating Android projects using Xamarin Forms in Visual Studio again.

    It's a great day!

    0 comments No comments