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

Bruce Krueger 331 Reputation points

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

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

Accepted answer
  1. Ahmad Uzair 81 Reputation points MVP

    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. Holly Schilling 1 Reputation point

    Did you ever resolve this? I’m now getting the same after I updated my Visual Studio for Mac to 8.9.1 (Build 34). Seems to only happen for Android projects.

  2. Holly Schilling 1 Reputation point

    For anyone finding this post, this was the problem I had.

    The work around was to ensure that the directory ~/Library/Android/sdk exists, even if it is empty.

    0 comments No comments

  3. Bruce Krueger 331 Reputation points

    I just need to find someone to tell me what the Windows directory needs to be.

    0 comments No comments

  4. Holly Schilling 1 Reputation point

    Yeah, sorry I can’t help you there.

    0 comments No comments