Xamarin Build Failure with CocosSharp Portable Game Template

225 Views Asked by At

So I'm not really sure where to go on this one. I resolved all the dependency issues I had when I loaded the CocosSharp Portable template but the Android Project in the solution just refuses to build.

C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2303,3): error XA4209: Failed to create JavaTypeInfo for class: Android.Support.V4.View.Accessibility.AccessibilityManagerCompat/IAccessibilityStateChangeListenerImplementor due to System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\Anthony\Source\Repos\CocosSharp Test Game Portable\CocosSharp Test Game Portable\CocosSharp Test Game Portable.Droid\obj\Debug\81\android\src\mono\android\support\v4\view\accessibility\AccessibilityManagerCompat_AccessibilityStateChangeListenerImplementor.java'.

I've seen a number of other questions that include a null reference exception when attempting to build this but not one that has could not find part of path.

What I've tried:

  • Clean and rebuild the entire solution
  • Clean and rebuild just the android project
  • Manually clean and build each individual project
  • Manually delete each project bin and obj folder and rebuild solution
  • Generating an android manifest in the android project properties page
  • Adding the BIND_ACCESSIBILITY_SERVICE permission in the android manifest
1

There are 1 best solutions below

0
Aude On

I had the same issue. The path is too long. Too solve this issue I changed the location of my solution folder to a location with a shorter path. That's it. Close the solution, move the folder and reopen the solution.