WARNING: [XmlResourcesTransformer] No mapping for: android/support/FILE_PROVIDER_PATHS
Asked Answered
S

1

8

On gradle sync, it errors with:

WARNING: [XmlResourcesTransformer] No mapping for: android/support/FILE_PROVIDER_PATHS
<provider android:name="androidx.core.content.FileProvider"
 android:authorities="${applicationId}.provider"
 android:exported="false"
 android:grantUriPermissions="true">
   <meta-data android:name="android.support.FILE_PROVIDER_PATHS"
    android:resource="@xml/provider_paths" />
</provider>

provider_paths.xml

<?xml version="1.0" encoding="utf-8"?>
<paths>
    <external-files-path
        name="my_images"
        path="." />
</paths>

How to solve this?

Sacroiliac answered 22/10, 2020 at 10:28 Comment(5)
I have added the relevant code, ` <provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths" /> </provider>`Airsickness
Please add your "relevant" code in the question, not as a comment :)Giraudoux
What's in provider_paths xml file?Anett
@Anett Added to the questionCostly
@ 于永志 : since this tool related question , please add version information (gradle, android ..) that may help to narrow down an answer.James
H
0

Likely this comes from Jetifier - and disabling it (while feasible) might work around the issue, as there won't be any attempts at mapping it. While android:exported="false" probably doesn't make much sense for a FileProvider, which usually is being supposed to be exported (exposed).

There's a blacklist for the Jetifier (in gradle.properties), in case it cannot be disabled:

android.jetifier.blacklist=android.support.FILE_PROVIDER_PATHS

And there's also an android.jetifier.ignorelist ...not sure what the actual difference is. This is only a guess, as I cannot reproduce the issue, but it still seems to be a quite likely guess.

Hawthorn answered 13/9, 2021 at 7:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.