{"id":1248,"date":"2024-01-13T23:20:12","date_gmt":"2024-01-13T15:20:12","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1248"},"modified":"2024-01-13T23:30:25","modified_gmt":"2024-01-13T15:30:25","slug":"android-7-and-above-fileprovider-crater-failed-to-find-configured-root-that-contains","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2024\/01\/13\/android-7-and-above-fileprovider-crater-failed-to-find-configured-root-that-contains\/","title":{"rendered":"Android 7.0\u53ca\u4ee5\u4e0aFileProvider\u5de8\u5751Failed to find configured root that contains"},"content":{"rendered":"<h3>module\u4e2dAndroidManifest.xml\u57fa\u672c\u914d\u7f6e<\/h3>\n<pre><code class=\"language-xml\">&lt;provider\n    android:name=&quot;android.support.v4.content.FileProvider&quot;\n    android:authorities=&quot;${applicationId}.fileProvider&quot;\n    android:grantUriPermissions=&quot;true&quot;\n    android:exported=&quot;false&quot;&gt;\n    &lt;meta-data\n        tools:replace=&quot;android:resource&quot;\n        android:name=&quot;android.support.FILE_PROVIDER_PATHS&quot;\n        android:resource=&quot;@xml\/file_paths&quot; \/&gt;\n&lt;\/provider&gt;<\/code><\/pre>\n<p><!-- more --><\/p>\n<h3>\u95ee\u9898\u63cf\u8ff0<\/h3>\n<p>\u5f53\u591a\u4e2amodule\u5206\u522b\u72ec\u7acb\u4f7f\u7528<code>FILE_PROVIDER_PATHS<\/code>\u65f6\uff0c\u53ea\u6709\u4e00\u4e2amodule\u7684<code>file_paths<\/code>\u6587\u4ef6\u662f\u6709\u6548\u7684<\/p>\n<p>\u4f8b\u5982\uff1a\u6709\u5982\u4e0b\u4f9d\u8d56\uff0c\u8fd0\u884c\u53d1\u73b0<code>order module<\/code>\u4e2d\u914d\u7f6e\u7684<code>FILE_PROVIDER_PATHS<\/code>\u672a\u88ab\u8bc6\u522b\uff0c\u629b\u51fa<code>Failed to find configured root that contains<\/code>\u5f02\u5e38<\/p>\n<pre><code>app &lt;- mine  &lt;- ptoho\n    &lt;- order &lt;- photo<\/code><\/pre>\n<p><code>ptoho module<\/code>\u7684<code>file_paths<\/code>\u6587\u4ef6<\/p>\n<pre><code class=\"language-xml\">&lt;resources&gt;\n    &lt;paths&gt;\n        &lt;cache-path path=&quot;photos\/camera&quot; name=&quot;photos&quot; \/&gt;\n        &lt;external-cache-path path=&quot;photos\/camera&quot; name=&quot;photos&quot; \/&gt;\n    &lt;\/paths&gt;\n&lt;\/resources&gt;<\/code><\/pre>\n<p><code>mine module<\/code>\u7684<code>file_paths<\/code>\u6587\u4ef6<\/p>\n<pre><code class=\"language-xml\">&lt;resources&gt;\n    &lt;paths&gt;\n        &lt;cache-path path=&quot;avatar\/camera&quot; name=&quot;avatar&quot; \/&gt;\n        &lt;external-cache-path path=&quot;avatar\/camera&quot; name=&quot;avatar&quot; \/&gt;\n    &lt;\/paths&gt;\n&lt;\/resources&gt;<\/code><\/pre>\n<p><code>order module<\/code>\u7684<code>file_paths<\/code>\u6587\u4ef6<\/p>\n<pre><code class=\"language-xml\">&lt;resources&gt;\n    &lt;paths&gt;\n        &lt;cache-path path=&quot;review\/camera&quot; name=&quot;review&quot; \/&gt;\n        &lt;external-cache-path path=&quot;review\/camera&quot; name=&quot;review&quot; \/&gt;\n    &lt;\/paths&gt;\n&lt;\/resources&gt;<\/code><\/pre>\n<h3>\u89e3\u51b3\u65b9\u6848<\/h3>\n<p>\u6240\u6709\u914d\u7f6e\u653e\u5728\u4e3b<code>app module<\/code>\u6216\u5176\u4e2d\u4e00\u4e2a\u5b50module\u4e2d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>module\u4e2dAndroidManifest.xml\u57fa\u672c\u914d\u7f6e &lt;provider android:nam [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[312],"class_list":["post-1248","post","type-post","status-publish","format-standard","hentry","category-android-basic","tag-fileprovider"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1248"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1248\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}