【Android错误集锦】Error:Execution failed for task ':app:processMockDebugManifest'.

错误描述:
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://*.com/questions/25981156/tools-replace-not-replacing-in-android-manifest
上一篇:centos/ubuntu挂载vmdk、 vdi为块设备的方法(非vdfuse)


下一篇:一道小小面试题的细节分析