gpt4 book ai didi

java - 未能找到包含/storage/emulated/0/Android/data/的已配置根目录

转载 作者:行者123 更新时间:2023-11-30 00:42:55 26 4
gpt4 key购买 nike

Java 文件:

java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/emulated/0/Android/data/com.chandan.halo/files/Pictures/JPEG_20170216_233855_-96483920.jpg

error in line Uri photouURI=......

if (photoFile != null) {
Uri photoURI = FileProvider.getUriForFile(this,
"com.chandan.halo.fileprovider",
photoFile);
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
startActivityForResult(takePictureIntent, 300);
}

文件路径.xml

    <?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="my_images" path="Android/data/com.chandan.halo/Pictures" />
<!--<external-cache-path name="name" path="path" />-->
</paths>

list .xml:

<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.chandan.halo.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>

最佳答案

替换:

<external-path name="my_images" path="Android/data/com.chandan.halo/Pictures" />

与:

<external-files-path name="my_images" path="Pictures" />

关于java - 未能找到包含/storage/emulated/0/Android/data/的已配置根目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42281744/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com