清单合并工具:替换失败 [英] Manifest Merger tools:replace failure
问题描述
我正在使用一个使用自己的android:theme的库,因此在构建时收到以下错误: 错误:(55,9)任务':contacit:processDebugManifest'的执行失败.
I am using a library which uses its own android:theme, and therefore I receive the following error while building: Error:(55, 9) Execution failed for task ':contacit:processDebugManifest'.
清单合并失败:AndroidManifest.xml中的属性application @ theme value =(@ style/Theme.MainTheme):55:9 也出现在com.github.florent37:materialviewpager:1.0.3.2:11:18 value =(@ style/AppTheme) 建议:在AndroidManifest.xml:49:5的元素上添加'tools:replace ="android:theme"'以覆盖
Manifest merger failed : Attribute application@theme value=(@style/Theme.MainTheme) from AndroidManifest.xml:55:9 is also present at com.github.florent37:materialviewpager:1.0.3.2:11:18 value=(@style/AppTheme) Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:49:5 to override
我已如下修改应用程序的AndroidManifest.xml:
I've modified my app's AndroidManifest.xml as follows:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.main"
android:versionCode="19"
android:versionName="2.5" >
...
<application
android:name="com.example.application.MainApplication"
tools:replace="android:theme"
android:allowBackup="true"
android:icon="@drawable/logo_icon"
android:label="@string/app_name"
android:theme="@style/Theme.MainTheme"
>
...
但是,即使我使用了tools:replace
属性,我仍然从清单合并中得到相同的错误.有什么想法吗?
However, even though I have used the tools:replace
attribute, I am still getting the same error from the Manifest merger. Any ideas why?
推荐答案
删除tools:replace
并将tools:node="replace"
添加到应用程序标记中.它对我有用.
Remove tools:replace
and add tools:node="replace"
to application tag. It works for me.
这篇关于清单合并工具:替换失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!