简体   繁体   中英

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

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

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>

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM