简体   繁体   English

Xamarin.forms、Android 部署问题。 应用程序无法在模拟器和物理设备上部署

[英]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 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 文件 "/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?您是否在 Android 属性下的 AndroidManifest.xml 下添加了以下代码?

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.请尝试更新您的xamarin formsXamarin.Essentials Z0558440846982BFE7FF23B159ZF9 到最新的再试一次。

If the problem persist, you can recheck if you have added the following code under Application tag as Krunal Bagadia said.如果问题仍然存在,您可以重新检查是否按照 Krunal Bagadia 所说,在Application标签下添加了以下代码。

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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