【发布时间】:2017-03-19 23:55:58
【问题描述】:
我正在尝试使用在其 AndroidManifest.xml 中包含此内容的库:
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.imagepicker.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
我的应用的 AndroidManifest.xml 中有相同的标签:
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="@string/FileProviderAuthority"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"></meta-data>
</provider>
所以它显然给出了一个 Manifest 合并错误:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
这建议“将 'tools:replace="android:authorities"' 添加到 AndroidManifest.xml 中的元素以覆盖”。
所以我像这样在我的应用的 AndroidManifest.xml 中添加tools:replace="android:authorities":
<application
tools:replace="android:authorities"
android:name=".appcontroller.AppController"
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">
然后我得到这个错误:
Error:
tools:replace specified at line:25 for attribute android:authorities, but no new value specified
tools:replace="android.support.v4.content.FileProvider" 也是如此。
我错过了什么?
【问题讨论】: