[英]Attribute application@allowBackup value=(false) from AndroidManifest.xml is also present at [:barcodescanner:] AndroidManifest.xml value=(true)
[英]EasyImage library: Attribute FILE_PROVIDER_PATHS from AndroidManifest.xml is also present at [com.github.jkwiecien:EasyImage
我正在使用https://github.com/jkwiecien/EasyImage中的EasyImage库。
我的AndroidManifest.xml
有这个:
<provider
android:name="`"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
编译时出现此gradle错误:
/home/babken/.../AndroidManifest.xml:216:13-64 Error:
Attribute provider#android.support.v4.content.FileProvider@authorities value=(com...fileprovider) from AndroidManifest.xml:216:13-64
is also present at [com.github.jkwiecien:EasyImage:1.3.1] AndroidManifest.xml:14:13-80 value=(com...easyphotopicker.fileprovider).
Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:214:9-222:20 to override.
/home/babken/.../AndroidManifest.xml:221:17-51 Error:
Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/file_paths) from AndroidManifest.xml:221:17-51
is also present at [com.github.jkwiecien:EasyImage:1.3.1] AndroidManifest.xml:19:17-50 value=(@xml/filepaths).
Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml:219:13-221:54 to override.
解决方案是使用您的自定义类扩展android.support.v4.content.FileProvider
并使用它:
package com....utils;
import android.support.v4.content.FileProvider;
public class CustomFileProvider extends FileProvider {
}
并在清单中使用它:
<provider
android:name=".utils.CustomFileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.