解决: Couldn‘t find meta-data for provider with authority xxx.fileProvider
解决apk安装出现的这个异常
Couldn't find meta-data for provider with authority 包名.fileProvider
其实这个问题已经跟你指出了错误的地方只要将相关的地方好好排查下就可以发现问题所在。
首先自查下AndroidManifest.xml
<providerandroid:name="androidx.core.content.FileProvider"android:authorities="包名.fileProvider" //确认此处的包名以及大小写android:exported="false"android:grantUriPermissions="true"><meta-dataandroid:name="android.support.FILE_PROVIDER_PATHS"android:resource="@xml/file_paths" /></provider>
然后看下相关代码
public void installApk(Context context, File file) {if (context == null) {return;}String authority = getApplicationContext().getPackageName() + ".fileProvider";//确保authority 与AndroidManifest.xml中android:authorities="包名.fileProvider"所有字符一致Uri apkUri = FileProvider.getUriForFile(context, authority, file);Intent intent = new Intent(Intent.ACTION_VIEW);intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);//判读版本是否在7.0以上if (Build.VERSION.SDK_INT >= 24) {intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);intent.setDataAndType(apkUri, "application/vnd.android.package-archive");} else {intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");}Log.i("DOWNLOAD", "installApk() startActivity(intent)");context.startActivity(intent);finish();}
解决: Couldn‘t find meta-data for provider with authority xxx.fileProvider相关推荐
- Couldn‘t find meta-data for provider with authority xxx.fileProvider
问题产生的原因: 两个应该是包名的地方不一致引起的 解决办法: 两个现实包名的地方 要一致 private fun update(filePath: String) {//安装应用val intent ...
- qt android meta data,Qt小技巧5.解决Failed to extract plugin meta data问题
使用Qt插件开发时,在debug模式下加载插件时遇到如下问题: "Failed to extract plugin meta data from './ICE-PCPUd. dll'&quo ...
- android meta data值获取的坑
2019独角兽企业重金招聘Python工程师标准>>> 获取meta data的时候,正常的非纯数字的字符串,设置在value里面,用getString获取是正常的. 但是如果含有纯 ...
- Skin Lesion Classification Using Ensembles of Multi-Resolution EfficientNets with Meta Data
abstract 本文我们描述了参加ISIC2019皮肤病变分类比赛.比赛中有两个任务,一是通过皮肤病变来分类皮肤病图像.二是利用图像和附加的患者元数据进行分类.包含25000张图像的庞大数据集提供给 ...
- mouted能不能访问data中的数据_Vue(定时器)解决mounted不能获取到data中的数据问题...
vue中data定义 data() { return { isok:10, } } 在vue中使用定时器 如下 mounted是钩子函数 mounted(){ console.log(this.iso ...
- 报错解决:alueError: When using data tensors as input to a model, you should specify the `steps_per_epoch
报错解决:valueError: When using data tensors as input to a model, you should specify the steps_per_epoch ...
- 成功解决ValueError: DataFrame.dtypes for data must be int, float or bool.Did not expect the data types
成功解决ValueError: DataFrame.dtypes for data must be int, float or bool. Did not expect the data types ...
- 成功解决TypeError: Cannot cast array data from dtype('float64') to dtype('U32') according to the rule '
成功解决TypeError: Cannot cast array data from dtype('float64') to dtype('<U32') according to the rul ...
- 成功解决 ValueError: feature_names mismatch training data did not have the following fields
成功解决 ValueError: feature_names mismatch training data did not have the following fields 目录 解决问题 解决思路 ...
- 成功解决AttributeError: module 'tensorflow.contrib.data' has no attribute 'TextLineDataset'
成功解决AttributeError: module 'tensorflow.contrib.data' has no attribute 'TextLineDataset' 目录 解决问题 解决思路 ...
最新文章
- 开发日记-20190905 关键词 Linux (Ubuntu) 下的Android模拟器:Genymotion
- 桥接模式、NAT模式、仅主机模式理解
- HDU - 6203 ping ping ping(LCA+dfs序+线段树)
- goland go test_七天用Go写个docker(第一天)
- Spring Boot端口从默认更改为自定义或新端口
- 怎么样把Java的字符串转化为字节数组?
- Java高级语法笔记-向上层抛出异常
- 无心剑中译迪米特利·马丁《我是谁》
- js文件位置--为甚有些js必须放在尾部
- 保障健康睡眠的几种食疗法
- 大企业中,Java面试官最爱问的问题集锦
- 如何写程序自动下载BBC Learning English的所有在线课程
- 【全网首发】言简意赅的Python全套语法,内附详细知识点和思维导图!【强烈建议收藏!】
- 图形化UDP发包小工具
- 浅谈:百度竞价恶意点击汇总及处理方法
- 浏览器的同源策略,以及为什么浏览器要用同源策略。
- Nacos-注册中心原理解析
- ubuntu设置相机为固定焦距
- 13种权重的计算方法
- “裸辞” 备战15天三面美团,交叉面却被吊起来锤