错误描述:
Error:Execution failed for task ':app:processMockDebugManifest'.
> Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:23:9-36
is also present at [net.qiujuer.common:okhttp:3.0.0] AndroidManifest.xml:17:9-35 value=(true).
Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:22:5-39:19 to override.
问题分析:
项目依赖库和主程序的allowBackup冲突
解决方法:
<application tools:replace="android:allowBackup"
android:name=".MyApplication"
android:allowBackup="false" >
添加tools:replace属性,替换要覆盖的标签属性即可。这样库文件中AndroidManifest文件标签属性会被主程序的标签属性替换掉。
参考:http://stackoverflow.com/questions/25981156/tools-replace-not-replacing-in-android-manifest