AndroidStudio中提示:Couldn‘t find meta-data for provider with authority

青旅半醒 2023-10-05 14:50 89阅读 0赞

场景

在配置应用更新时下载完安装包之后进行安装中的提示:

Couldn’t find meta-data for provider with authority 后面跟你的包名

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0JBREFPX0xJVU1BTkdfUUlaSEk_size_16_color_FFFFFF_t_70

博客:
https://blog.csdn.net/badao_liumang_qizhi
关注公众号
霸道的程序猿
获取编程相关电子书、教程推送与免费下载。

实现

找到AndroidManifest.xml中配置FileProvider的地方

  1. <!--在安卓7.0以上禁止在应用外部公开 file://URI-->
  2. <provider
  3. android:name="androidx.core.content.FileProvider"
  4. android:authorities="com.bado.你的包名.fileProvider"
  5. android:grantUriPermissions="true"
  6. android:exported="false">
  7. <meta-data
  8. android:name="android.support.FILE_PROVIDER_PATHS"
  9. android:resource="@xml/file_path" />
  10. <!--上面的resource="xxx"指的是一个文件,file_path是文件名-->
  11. </provider>

将这里的authorities后面的xxx.xx.xx.fileProvider修改为自己的应用对应的包名

发表评论

表情:
评论列表 (有 0 条评论,89人围观)

还没有评论,来说两句吧...

相关阅读