如何将FileProvider迁移到androidx?
在清单文件中,如何指定FileProvider?
<provider android:authorities="${applicationId}.FileProvider" android:name="which.package.to.put.here.FileProvider"
android:enabled="true"
android:exported="false"
android:grantUriPermissions="true">
<meta-data android:name="which.package.to.put.here.FILE_PROVIDER_PATHS"
android:resource="@xml/file_path" />
</provider>我尝试使用androidx.core.content.FileProvider,但得到以下错误:
java.lang.RuntimeException: Unable to get provider androidx.core.content.FileProvider: java.lang.IllegalArgumentException: Missing android.support.FILE_PROVIDER_PATHS meta-data发布于 2018-12-15 18:45:57
这似乎解决了这个问题:
<provider
android:authorities="${applicationId}.FileProvider"
android:name="androidx.core.content.FileProvider"
android:enabled="true"
android:exported="false"
android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_path" />
</provider>https://stackoverflow.com/questions/53791571
复制相似问题