一、产生的经由
用安全工具测试apk漏洞时发现以下安全风险:

于是我就在Manifest中改过来
<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
>
本以为解决了,改完后,编译又出现新问题
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
网上查了一下问题:找到了解决方案,亲测有效,再此记录下来,便于后人查阅
- 首先加上命名空间
xmlns:tools="http://schemas.android.com/tools"

- 然后再加入tools:replace="android:allowBackup"
<application
android:allowBackup="false"
tools:replace="android:allowBackup"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
>
二、为何如此修改
原因是其他Library与主项目配置了相同allowBackup属性,系统不知道用谁的,加入上面的代码,可以告知编译器,用主项目的配置
公众号

网友评论