1. 程式人生 > >add 'tools:replace="android:allowBackup"' to 報錯

add 'tools:replace="android:allowBackup"' to 報錯

報錯內容:

Error:Execution failed for task ':DaPingGuo:processdapinguoManifest'.

> Manifest merger failed : Attribute [email protected] value=(false) from AndroidManifest.xml:46:9-36
is also present at [com.dadada.analysis:dadadaio:3.2.1] AndroidManifest.xml:16:9-35 value=(true).

Suggestion: add 'tools:replace="android:allowBackup

"' to <application> element at AndroidManifest.xml:44:5-576:19 to override.

一般會在引入第三方jar包的時候出現衝突~

根據建議只要添即可解決:

原始碼

    <application
        android:name="com.dapingguo.application.MyApplication"
        android:allowBackup="false"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppBaseTheme">

根據修改意見新增以下程式碼:

tools:replace="android:allowBackup"
 <application
        android:name="com.dapingguo.application.MyApplication"
        android:allowBackup="false"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppBaseTheme"
        tools:replace="android:allowBackup">
成功!!!