Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
賴包時,選擇其一,例如:appcompat-v7包在本地項目中有依賴,compile
'com.android.support:appcompat-v7:25.3.1' ,aar文檔中也要添加依賴 compile 'com.android.support:appcompat-v7:23.0.1',這兩種版本反應了本項目SDK編譯版本用的是25,而導入的aar包原項目爲23,一般去掉等級低的依賴包,這裏保留 compile 'com.android.support:appcompat-v7:25.3.1' 。當把重複的包去掉之後,如果項目還報錯,如下
> Manifest merger failed : Attribute application@allowBackup value=(true) from AndroidManifest.xml:29:9-35
is also present at [:WbCloudFaceVerifySdk-proRelease-v1.3.89-c596764:] AndroidManifest.xml:25:9-36 value=(false).
Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:27:5-196:19 to override.
那說明本項目與導入項目之間存在重複調用的問題,例如Maniest 合併時候報的錯誤:Manifest merger failed 。按提示將AndroidManifest 中application標籤下的內容改成tools:replace,這裏是由於aar包中有allowBackup屬性,本地項目也含有allowBackup屬性並且雙方涉值不一致,因此需要去重,並且讓子項目跟隨主項目值去取,修改如下:
<application
android:name="com.ybej.wallet.Base.MainApp"
tools:replace = "android:allowBackup"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:allowBackup="false"
android:supportsRtl="true"
android:theme="@style/AnimationActivity">
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
這裏的原因還是AndroidManifest文件合併失敗。