Weird behavior if I try to deploy my project on my phone, but it complies correctly

Cesar Rangel 96 Reputation points
2021-01-15T15:40:24.517+00:00

Long story short ...

I've been working on a Xamarin Forms app since December 2019, an i've been updating my Xamaring Forms so I can keep it up running with the latest features so far so good until Xamarin 5 came in. This version asks me to change my compileskdversion from 9 or lower to at least 10, so I did.

My app runs smoothly with android 9.0 (Pie) and Xamarin Forms 4.8.0.1821 (latest before 5.0.0.1874 official realese version) The moment I change my SDK and try to run it on my physical phone it throws me this 2 errors:

Gravedad Código Descripción Proyecto Archivo Línea Estado suprimido Error XARDF7023: System.IO.DirectoryNotFoundException: No se puede encontrar una parte de la ruta de acceso 'AccessibilityManagerCompat_AccessibilityStateChangeListenerImplementor.class'. en System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data) en System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost) en Xamarin.Android.Tasks.RemoveDirFixed.RunTask()

Gravedad Código Descripción Proyecto Archivo Línea Estado suprimido Error XARDF7024: System.IO.IOException: El nombre de archivo, el nombre de directorio o la sintaxis de la etiqueta del volumen no son correctos. en System.IO.Error.WinIOError(Int32 errorCode, String maybeFullPath) en System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data) en System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost) en Xamarin.Android.Tasks.RemoveDirFixed.RunTask()

(sorry if some parts of the error comes in spanish).

The thing here is only when I change mi SDK, I've tried to

  1. Clean and rebuilt
  2. Install some .NET Compilers in my Xamarin Android Project
  3. Install the Xamarin.AndroidX dependencies (That works fine with Android 9 (Pie))
  4. Use another machine to compile
  5. Change phone
  6. Remove old dependencies

Aditionally on my "AndroidManifest" I have a few things but it may help:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.company.app" android:installLocation="preferExternal" android:versionName="1.19.1" android:versionCode="19">
    <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
    <uses-permission android:name="android.permission.CONTROL_LOCATION_UPDATES" />
    <uses-permission android:name="android.permission.INSTALL_LOCATION_PROVIDER" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <!--<uses-permission android:name="android.permission.READ_CONTACTS" />-->
    <uses-permission android:name="android.permission.READ_CALENDAR" />
    <uses-permission android:name="android.permission.WRITE_CALENDAR" />
    <application android:label="app name" android:icon="@drawable/icon" android:usesCleartextTraffic="true">
        <provider android:name="android.support.v4.content.FileProvider" android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true">
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"></meta-data>
        </provider>
    </application>
</manifest>

I've tried also to change the SDK To Android 11 (R) and still the same problem
.
I cannot debug the code because it's unable even to deploy it, it fails before it can be debugged

I've to say I don't even know where to look with this error.

Please if anyone can help me solve this.

Thank you very much everyone! :D

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

Accepted answer
  1. Cesar Rangel 96 Reputation points
    2021-01-21T15:15:40.763+00:00

    Sorry i forget to post the answer here.

    I'm running my project on a Microsoft PC and my source folder was too long.
    This specific error ocurred because there is a Path-Limit violation.

    So short answer. saved my project folder on a shorter path something like C:\Work \ [Project-Folder]

    The solution was very simple but it got me stucked quite some time. I hope this post can help others!!

    Thank you very much for all your help

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.