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

场景

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

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

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

实现

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

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

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

博客园: https://www.cnblogs.com/badaoliumangqizhi/ 关注公众号 霸道的程序猿 获取编程相关电子书、教程推送与免费下载。
原文地址:https://www.cnblogs.com/badaoliumangqizhi/p/14070949.html