question

BruceKrueger-2659 avatar image
0 Votes"
BruceKrueger-2659 asked Jharedtroll23-5978 published

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

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

dotnet-xamarin
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Does this error come from a new project or an existed project? If this issue comes from a new project, update your VS to the latest version and click the Repair selection in the VS installer. If this issue comes from an existed project, please share related code or a simple demo to reproduce this issue.

0 Votes 0 ·
ddtechboy avatar image
1 Vote"
ddtechboy answered Jharedtroll23-5978 published

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This! You saved me from desperation on my finals week.

I just changed the file directory to the repo and worked like a charm!

0 Votes 0 ·
HollySchilling-5125 avatar image
0 Votes"
HollySchilling-5125 answered HollySchilling-5125 commented

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.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

In Visual Studio for Windows, I went to Tools: Get Tools and Features and on Visual Studio Community I selected "More" and did repair.
I also went Android SDK Manager and did any updates.
Lastly I went into NuGet Package Manager and updated.

Doing all three of these fixed my problem.

Good Luck!

1 Vote 1 ·

Thanks for your sharing.

0 Votes 0 ·

I am now getting this error again.
I have the most current Visual Studio that I did repair, updated Android SDK Manager, and updated NuGet.

What can I do to Fix???

0 Votes 0 ·
Show more comments
HollySchilling-5125 avatar image
0 Votes"
HollySchilling-5125 answered HollySchilling-5125 edited

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BruceKrueger-2659 avatar image
0 Votes"
BruceKrueger-2659 answered

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

HollySchilling-5125 avatar image
0 Votes"
HollySchilling-5125 answered

Yeah, sorry I can’t help you there.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BruceKrueger-2659 avatar image
0 Votes"
BruceKrueger-2659 answered BruceKrueger-2659 commented

Hoping LeonLu-MSFT can.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Do you mean this path: C:\Program Files (x86)\Android\android-sdk ?


78222-image.png


0 Votes 0 ·
image.png (41.5 KiB)

That seems like a reasonable parallel to the Mac ~/Library/Android/sdk.

0 Votes 0 ·

I found a path like this screenshot.


78706-image.png


0 Votes 0 ·
image.png (142.5 KiB)
Show more comments
BruceKrueger-2659 avatar image
0 Votes"
BruceKrueger-2659 answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BruceKrueger-2659 avatar image
0 Votes"
BruceKrueger-2659 answered

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!

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.