add 'tools:replace="android:value"' to <meta-data> element问题的解决
2016-10-11 23:08
483 查看
今天在使用极光推送,并且准备对渠道打包的时候,在manifest中添加了:
多渠道替换通道以后,编译出现如下错误信息:
Error:Execution failed for task ':app:processBaiduDebugManifest'.
> Manifest merger failed : Attribute meta-data#JPUSH_CHANNEL@value value=(baidu) from AndroidManifest.xml:68:45-77
is also present at [cn.jiguang:jpush:2.1.9] AndroidManifest.xml:122:13-45 value=(${JPUSH_CHANNEL}).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:68:5-79 to override.
意思差不多是说,manifest合并失败,JPUSH_CHANNEL这个属性出现在2的地方,建议添加 tools:replace="android:value" 来重写
开始我就用 tools:replace="android:value" 来替换:
在application标签下添加了:
后 结果没能解决问题 反而出现了新的问题. 搜索也没有找到有用的信息,
后来发现,這里不是替换,而是要添加, 我看那上面说Override 我就替换掉 是不对的,添加上去就好了:
這样就Ok了
<meta-data android:name="CHANNEL" android:value="${CHANNEL_VALUE}" />
多渠道替换通道以后,编译出现如下错误信息:
Error:Execution failed for task ':app:processBaiduDebugManifest'.
> Manifest merger failed : Attribute meta-data#JPUSH_CHANNEL@value value=(baidu) from AndroidManifest.xml:68:45-77
is also present at [cn.jiguang:jpush:2.1.9] AndroidManifest.xml:122:13-45 value=(${JPUSH_CHANNEL}).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:68:5-79 to override.
意思差不多是说,manifest合并失败,JPUSH_CHANNEL这个属性出现在2的地方,建议添加 tools:replace="android:value" 来重写
开始我就用 tools:replace="android:value" 来替换:
<meta-data android:name="JPUSH_CHANNEL" tools:replace="android:value" />
在application标签下添加了:
xmlns:tools="http://schemas.android.com/tools"
后 结果没能解决问题 反而出现了新的问题. 搜索也没有找到有用的信息,
后来发现,這里不是替换,而是要添加, 我看那上面说Override 我就替换掉 是不对的,添加上去就好了:
<meta-data android:name="JPUSH_CHANNEL" tools:replace="android:value" android:value="${CHANNEL_VALUE}"/>
這样就Ok了
相关文章推荐
- Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:25:5-2
- add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:25:5-27:34 to over
- Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:25:5-2
- [置顶] Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:25:5-2
- Suggestion: add 'tools:replace="android:value"' to <meta-data> element 报错解决方案
- Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:22:5-2
- Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:25:5-27:41 to override.
- Manifest merger failed Suggestion: add 'tools:replace=“Android:value”' to <meta-data> element at And
- Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml
- Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml
- Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml
- Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xm
- 出现add 'tools:replace="android:value"' to element at AndroidManifest.xml:22:5-24:34 to override.的解决办法
- Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml
- Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:28:5
- AndroidManifest 文件合并错误-->tools:replace="android:value"问题
- Android Studio uggestion: add 'tools:replace="android:theme" 问题
- hadoop "File /user/<user>/input/conf/slaves could only be replicated to 0 nodes, instead of 1"问题及解决办
- hadoop "File /user/<user>/input/conf/slaves could only be replicated to 0 nodes, instead of 1"问题及解决办
- Android <meta-data>