FileProvider相关 Failed to find configured root that contains错误

来源:互联网 发布:什么是自动编程系统 编辑:程序博客网 时间:2024/06/05 17:34

问题:

java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/**
at android.support.v4.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:678)
at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:377)


这是在android6.0以上进行程序间文件共享使用FileProvider时出现的构造SD卡异常错误


解决方案:

在file_paths.xml文件中添加root-path 标签

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

就可以了


阅读全文
0 0
原创粉丝点击