问题:

使用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. 在 .NET项目中使用 Redis(2018.10.16)

    1. 打开NuGet管理器搜索redis,安装:“StackExchange.Redis” 2. 配置 Web.config 文件 <connectionStrings> <add ...

  2. 谈谈Java中的volatile(转载)

    内存可见性 留意复合类操作 解决num++操作的原子性问题 禁止指令重排序 总结 内存可见性 volatile是Java提供的一种轻量级的同步机制,在并发编程中,它也扮演着比较重要的角色.同synch ...

  3. Win10系列:C#应用控件进阶1

    线形 线形没有内部空间,若要呈现一条直线,需要用Line对象的Stroke和StrokeThickness 属性分别为其轮廓的颜色及轮廓的粗细赋值,若不设置这两个属性,线形将不会呈现.绘制一条线形图形 ...

  4. python笔记8-列表list操作、多维数组

    #!/usr/bin/python #python里面有个这个话,代表在linux下运行的时候#去哪个目录下找python的解释器,在windows上运行不用写# coding:utf-8# __*_ ...

  5. 用canvas画一个房子

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <script t ...

  6. ARTS(一)

    ARTS第一周,2019年3月17日,星期日,天气晴. A:算法学习(Algorithm) 将一个给定字符串根据给定的行数,以从上往下.从左到右进行 Z 字形排列. 比如输入字符串为 "LE ...

  7. laravel 创建自动化生成数据库

    1.   生成 迁移脚本 php artisan make:migration create_users_table --create=users(表名) 当你⽣成⼀个模型时想要顺便⽣成⼀个 数据库迁 ...

  8. python基础--基础练习题(一)

    1. 输出如下内容: 1 1 2 1 2 2 3 1 3 2 3 3 4 1 4 2 4 3 4 4 思路:应该是要用两个循环,外层循环控制第一个数字,内层控制输出的次数 for i in range ...

  9. CentOS7 cannot find a valid baseurl for repo base

    找到文件夹: cd /etc/sysconfig/network-scripts/ 然后找ifcfg 开头的文件,挨个打开 里面有下面那些代码前三行的就是,添加后面DNS两行,保持并退出,然后继续执行 ...

  10. c# 如何 使用共用体

    用起来真的方便 转摘如下: C#借助FieldOffset属性实现共用体与强制类型转换 这两天被C#的强制类型转换弄得有点不习惯.事出如此. 在C#中,我打算读二进制文.文件的结构很简单,一连串的紧密 ...