question

BruceKrueger-2659 avatar image
2 Votes"
BruceKrueger-2659 asked Assembler-3973 commented

Why am I getting this error on a new Xamarin Forms Android Project?

XARDF7023: System.IO.DirectoryNotFoundException: Could not find a part of the path 'AccessibilityManagerCompat_AccessibilityStateChangeListenerImplementor.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()
XARDF7024: System.IO.IOException: The filename, directory name, or volume label syntax is incorrect.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
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()
Done building project "ColorGames.Android.csproj" -- FAILED.


The Registry is already set to allow long file paths.

dotnet-xamarin
· 3
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.

Hi, BruceKrueger-2659. What's version of the VS on your pc? And what is version of the Android SDK in your project. Try to update the VS and SDK to the lastest stable version, then test the sample again. If it still doesn't work, try to open the VS Installer to repair the vs.

1 Vote 1 ·

Visual Studio Community 2019 Version 16.9.1

Android SDK 11.2.0.21

I already tried running repair on Visual Studio.

I started a Test Project with nothing done to the project except making sure everything including the NuGet packages were current.

I still am getting the error.

0 Votes 0 ·

II have got the same Errorcode, but a slightly different Error:

 XARDF7023: System.IO.DirectoryNotFoundException: Ein Teil des Pfades "AlertDialog_IDialogInterfaceOnCancelListenerImplementor.class" konnte nicht gefunden werden.
    bei System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data)
    bei System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
    bei Xamarin.Android.Tasks.RemoveDirFixed.RunTask()             0    
    
    
 XARDF7024: System.IO.IOException: Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch.
    
    bei System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    bei System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data)
    bei System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
    bei Xamarin.Android.Tasks.RemoveDirFixed.RunTask()             0    

As of some comments I got track of the Problem. My path is to long, because of the length of my project name. To give you additional information: I am using Windows 10. I also messed around with the length of the Projectname and its indirectly also a problem. This name is used for 3 folders. So do not choose a long project name and watch out for the path length.


Greetings
Assembler


0 Votes 0 ·
BruceKrueger-2659 avatar image
0 Votes"
BruceKrueger-2659 answered JarvanZhang-MSFT edited

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.

JarvanZhang-MSFT avatar image
3 Votes"
JarvanZhang-MSFT answered JarvanZhang-MSFT edited

Hello,​

Welcome to our Microsoft Q&A platform!

Someone faced the similar issue, the problem is because the path of the project is too long. Try to save the project in a short path such as E:\work_space\project_folder and don't use too long names for project folders and classes.

Similar issue: https://docs.microsoft.com/en-us/answers/questions/232440/weird-behavior-if-i-try-to-deploy-my-project-on-my.html

Best Regards,

Jarvan Zhang



If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


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.

ddtechboy avatar image
0 Votes"
ddtechboy answered

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!

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.

SreejithKrishnadas-5214 avatar image
0 Votes"
SreejithKrishnadas-5214 answered

Maybe Somewhat linked to @ddtechboy 's answer:

My project was building fine but was getting the XARSD7023 error during deployment. The solution was placed in a directory that was deep inside my HDD folder structure. I moved it to a root directory like "C:/" Drive and the error went away. Not exactly sure why doing this fixed it but I am cool as long as it works. Hope this info helps someone.

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.