Home > Net >  Xamarin.forms, Android deployment issue. App is failing to Deploy on Emulators and physical devices
Xamarin.forms, Android deployment issue. App is failing to Deploy on Emulators and physical devices

Time:12-13

UNHANDLED EXCEPTION: [MonoDroid] Java.Lang.RuntimeException: Unable to get provider androidx.core.content.FileProvider: java.lang.ClassNotFoundException: Didn't find class "androidx.core.content.FileProvider" on path: DexPathList[[zip file "/data/app/~~pZAuPuPF-r125lb9dLdbVw==/com.cfj.TrialwatchApp-RevQziFDZKEkLVVkaCkhEg==/base.apk"],nativeLibraryDirectories=[/data/app/~~pZAuPuPF-r125lb9dLdbVw

CodePudding user response:

have you added below code under AndroidManifest.xml under Android Properties?

Please Add Below Code under Application Tag.

<provider android:name="androidx.core.content.FileProvider" android:authorities="yourpackagename.fileprovider" android:grantUriPermissions="true" android:exported="false">
        <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/filepaths" />
</provider>

CodePudding user response:

Please try to update your xamarin forms and Xamarin.Essentials nuget to the latest ones and try again.

If the problem persist, you can recheck if you have added the following code under Application tag as Krunal Bagadia said.

<provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true">
        <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths" />
</provider>
  • Related