Migrating to AndroidX - android.support.FILE_PROVIDER_PATHS location

谁都会走 提交于 2019-12-13 11:54:00

问题


I am in the middle of migrating a project to AndroidX and I am blocked with an issue.

<provider
    android:name="androidx.core.content.FileProvider" <--- Changed to X lib
    android:authorities="${applicationId}.fileprovider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS" <---- ISSUE
        android:resource="@xml/file_paths" />
</provider>

I searched all the Internet and couldn't find a solution for this: what should I add instead of android.support.FILE_PROVIDER_PATHS for AndroidX?


回答1:


still the same. android.support.FILE_PROVIDER_PATHS is in the example here




回答2:


<meta-data
    android:name="android.support.FILE_PROVIDER_PATHS"
    android:resource="@xml/file_paths" />

For androidx, the metadata should be like this. Checkout this from android studio : https://developer.android.com/reference/androidx/core/content/FileProvider.html



来源:https://stackoverflow.com/questions/53390060/migrating-to-androidx-android-support-file-provider-paths-location

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!