问题:

使用FileProvider构造SD卡中文件uri时异常

java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/840E-10F6/音乐/千里之外.mp3
at android.support.v4.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:678)
at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:377)

解决方案:

provider_paths.xml 中增加 root-path 标签

<paths xmlns:android="http://schemas.android.com/apk/res/android">

    <root-path
name="root_path"
path="." /> </paths>

FileProvider相关 Failed to find configured root that contains的更多相关文章

  1. Android FileProvider相关 Failed to find configured root that contains

    问题: 使用FileProvider构造SD卡中文件uri时异常 java.lang.IllegalArgumentException: Failed to find configured root ...

  2. Failed to find configured root that contains

    这个主要问题是在android系统下7.0 拍照时,Android提供FileProvider类来供应用之间共享数据. 出现这个问题多为xml文件 path 类型和代码中调用的类型不同导致的 以下为多 ...

  3. python开发环境软件包安装相关 failed with error code 1 in /tmp/pip-build-vn_f_e1n/psutil/

    指定源安装 pip install git+https://github.com/xxxxxx.git pip install -r requirements.txt -i https://mirro ...

  4. Cannot run CentOS 7 or RHEL 7 installer: “Failed to start Switch Root”

    这个问题是由于安装程序默认的LABEL对于你要安装的磁盘系统分区不匹配造成的 通过编辑引导参数来使安装程序运行 在选择安装选项之前,按‘e’添加相应的引导参数

  5. 为安卓项目添加FileProvider

    简单记录 android7.0开始出现FileProvider.从一个小白角度看需要注意这几点: Manifest.xml中添加provider节点 添加xml文件 模块的build.gradle中添 ...

  6. 应用中对APK进行安装

    权限 <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/> //允 ...

  7. FileUriExposedException_Android7.0适配

    一. FileUriExposedException的解决 问题 由于在Android7.0上,google使用了新的权限机制,所以导致在调用相机的时候,如果传递的URI为”file://”类型,的系 ...

  8. Android 解析包时出现问题 的解决方案(应用检查更新)

    问题描述我们在进行Android开发的时候,一般都会在应用里检测有没有更新,并且从网上下载最新的版本包,覆盖本地的旧版本.在我的项目中,出现了一个问题,就是当安装包下载到本地的时候,产生了" ...

  9. Ubuntu14.04安装ROOT集群

    之前尝试在CentOS7上部署ROOT集群,却发现无论是源码包安装,还是官方提供的二进制包,都缺少了关键的xproofd可执行文件,导致PoD不能运行.没有办法,只能尝试在其他OS上部署,这里我选择了 ...

随机推荐

  1. javascript高级程序设计第3版——第一章概括

    最近发现Xmind思维导图是个好东西,刚好开始看书,被用来归纳最好不过了

  2. Vue(九) 自定义指令

    前面介绍了许多 Vue 内置的指令,比如 v-if.v-show等,这些丰富的指令能满足我们绝大部分的业务需求,不过在需要一些特殊功能时,我们仍然希望对 DOM 进行底层的操作,这时就要用到自定义指令 ...

  3. PS切图采坑

    博客记录我的各种采坑,有的坑很水,比如下面这个 谨记录自己的坑,以后作为入门笑料. 拿到设计师的psd设计图,理清事件逻辑,接下来就要切图啦.结果PS老是crash!检查了PS版本,也不低啊2017. ...

  4. 指导手册01:安装Hadoop

    指导手册01:安装Hadoop  Part 1:安装及配置虚拟机 1.安装Linux. (1)打开VMvirtualBox (2) 控制->新建虚拟机,输入虚拟机名称“marst+学号” 类型: ...

  5. [Spring Boot]什么是Spring Boot

    <Spring Boot是什么> Spring Boot不是一个框架 是一种用来轻松创建具有最小或零配置的独立应用程序的方式 用来开发基于Spring的应用,但只需非常少的配置. 它提供了 ...

  6. day 07 元组,字典和集合等数据类型介绍

    元组:就是一个不可变的列表 1.用途,当我们需要记录多个值,并且没有更改的需求的时候,应该使用元组 2定义方式:使用,在 ( ) 中分隔开多个任意类型的值 注:t=("egg",) ...

  7. Python 测试多进程的时间

    import time from multiprocessing import Process def f1(): time.sleep(2) print("子进程1号") def ...

  8. 非常好的开源C项目tinyhttpd(500行代码)

    编译命令 gcc -W -Wall -lpthread -o httpd httpd.c 源码 #include <stdio.h> #include <sys/socket.h&g ...

  9. sqlserver2008数据库自动备份的sql脚本及使用bat命令执行脚本

    -----sql脚本 declare @fileName varchar(255) ,--定义备份文件名变量         @dbname varchar(255)--定义备份数据库名变量decla ...

  10. Mysql 杀死sleep进程

    查询数据库当前设置的最大连接数:查看mysql数据库连接数.并发数相关信息  show global variables like '%max_connections%'; 查看mysql连接数:my ...