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,314 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. Holly Schilling 1 Reputation point
    2021-03-12T14:56:54.533+00:00

    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
    2021-03-15T20:14:24.68+00:00

    For anyone finding this post, this was the problem I had.
    https://github.com/xamarin/xamarin-android/issues/5722

    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
    2021-03-15T20:19:25.767+00:00

    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
    2021-03-15T20:21:03.777+00:00

    Yeah, sorry I can’t help you there.

    0 comments No comments