這可謂經(jīng)典錯(cuò)誤了诗充,
Manifest merger failed
的意思是清單文件合并錯(cuò)誤,首先是可以定位AndroidManifest.xml
文件了诱建。
錯(cuò)誤等級(jí) 高
因?yàn)殄e(cuò)誤不明顯蝴蜓,所以解決起來貌似非常困難
對(duì)于新手來說就是太浮躁,不仔細(xì)看錯(cuò)誤就會(huì)忽略這些錯(cuò)誤細(xì)節(jié),ok 我這次靜下心來分析了一把
點(diǎn)擊gradle console
ADDED from [cn.jiguang.sdk:jpush:3.0.5] C:\speed\other\.gradle\caches\transforms-1\files-1.1\jpush-3.0.5.aar\be57b9ec491b0e03a84674b5c983513d\AndroidManifest.xml:78:13-36
android:name
ADDED from [cn.jiguang.sdk:jpush:3.0.5] C:\speed\other\.gradle\caches\transforms-1\files-1.1\jpush-3.0.5.aar\be57b9ec491b0e03a84674b5c983513d\AndroidManifest.xml:76:13-66
intent-filter#${JPUSH_PKGNAME}+cn.jpush.android.intent.DaemonService
ADDED from [cn.jiguang.sdk:jpush:3.0.5] C:\speed\other\.gradle\caches\transforms-1\files-1.1\jpush-3.0.5.aar\be57b9ec491b0e03a84674b5c983513d\AndroidManifest.xml:79:13-83:29
intent-filter#cn.jpush.android.intent.DaemonService+com.buyao.tv
ADDED from [cn.jiguang.sdk:jpush:3.0.5] C:\speed\other\.gradle\caches\transforms-1\files-1.1\jpush-3.0.5.aar\be57b9ec491b0e03a84674b5c983513d\AndroidManifest.xml:79:13-83:29
action#cn.jpush.android.intent.DaemonService
ADDED from [cn.jiguang.sdk:jpush:3.0.5] C:\speed\other\.gradle\caches\transforms-1\files-1.1\jpush-3.0.5.aar\be57b9ec491b0e03a84674b5c983513d\AndroidManifest.xml:80:17-80
android:name
ADDED from [cn.jiguang.sdk:jpush:3.0.5] C:\speed\other\.gradle\caches\transforms-1\files-1.1\jpush-3.0.5.aar\be57b9ec491b0e03a84674b5c983513d\AndroidManifest.xml:80:25-77
//之后是紅色文字日志
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
:app:processDebugManifest FAILED
:app:processDebugManifest (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 0.738 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
* Try:
Run with --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugManifest'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ResolveBuildCacheKeyExecuter.execute(ResolveBuildCacheKeyExecuter.java:61)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: java.lang.RuntimeException: Manifest merger failed with multiple errors, see logs
at com.android.builder.core.AndroidBuilder.mergeManifestsForApplication(AndroidBuilder.java:517)
at com.android.build.gradle.tasks.MergeManifests.doFullTaskAction(MergeManifests.java:143)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
... 30 more
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 22s
233 actionable tasks: 221 executed, 12 up-to-date
The build scan was not published due to a configuration problem.
The Gradle Cloud Services license agreement has not been agreed to.
從紅色日志可以看出來之前是處理了jpush,可以看出來可能是某些東西已經(jīng)添加了茎匠,但是發(fā)現(xiàn)jiguagnpush里面也有格仲。
從上面的錯(cuò)誤可以發(fā)現(xiàn)是添加了這個(gè)
android:name
ADDED from [cn.jiguang.sdk:jpush:3.0.5] C:\speed\other\.gradle\caches\transforms-1\files-1.1\jpush-3.0.5.aar\be57b9ec491b0e03a84674b5c983513d\AndroidManifest.xml:80:25-77
進(jìn)去導(dǎo)致的錯(cuò)誤
打開文件
C:\speed\other\.gradle\caches\transforms-1\files-1.1\jpush-3.0.5.aar\be57b9ec491b0e03a84674b5c983513d\AndroidManifest.xml:80:2
找到80行
<service
android:name="cn.jpush.android.service.DaemonService"
android:enabled="true"
android:exported="true" >
<intent-filter>
<action android:name="cn.jpush.android.intent.DaemonService" />
<category android:name="${JPUSH_PKGNAME}" />
</intent-filter>
</service>
ok,看下圖,那么看看自己的項(xiàng)目是否也添加了诵冒,解決方法就是刪除就ok,所以總結(jié)就是有時(shí)候不需要自己再配置了凯肋,我是因?yàn)槭詹坏阶远x廣播才懷疑是不是這些東西沒添加導(dǎo)致的,誰知道坑死汽馋,原來是host
忘記改了
另外如果你的gradle沒有這么詳細(xì)的錯(cuò)誤
打開Android Studio 設(shè)置
Compiler->Comand line Options:
--stacktrace --info --scan
如下圖所示
發(fā)現(xiàn)問題遠(yuǎn)沒那么簡(jiǎn)單
eceiver#cn.jpush.android.service.AlarmReceiver
ADDED from [cn.jiguang.sdk:jpush:3.0.5] C:\speed\other\.gradle\caches\transforms-1\files-1.1\jpush-3.0.5.aar\be57b9ec491b0e03a84674b5c983513d\AndroidManifest.xml:110:9-112:40
android:exported
ADDED from [cn.jiguang.sdk:jpush:3.0.5] C:\speed\other\.gradle\caches\transforms-1\files-1.1\jpush-3.0.5.aar\be57b9ec491b0e03a84674b5c983513d\AndroidManifest.xml:112:13-37
android:name
ADDED from [cn.jiguang.sdk:jpush:3.0.5] C:\speed\other\.gradle\caches\transforms-1\files-1.1\jpush-3.0.5.aar\be57b9ec491b0e03a84674b5c983513d\AndroidManifest.xml:111:13-66
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
All input files are considered out-of-date for incremental task ':sharesdk:generateDebugRFile'.
Unable do incremental execution: full task run
:app:processDebugManifest FAILED
:app:processDebugManifest (Thread[Task worker for ':',5,main]) completed. Took 0.329 secs.
:pulltorefresh_library:generateDebugRFile (Thread[Daemon worker Thread 4,5,main]) completed. Took 0.277 secs.
:sharesdk:generateDebugRFile (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.204 secs.
:IMKit:packageDebugResources (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 3.21 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
* Try:
Run with --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugManifest'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ResolveBuildCacheKeyExecuter.execute(ResolveBuildCacheKeyExecuter.java:61)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: java.lang.RuntimeException: Manifest merger failed with multiple errors, see logs
at com.android.builder.core.AndroidBuilder.mergeManifestsForApplication(AndroidBuilder.java:517)
at com.android.build.gradle.tasks.MergeManifests.doFullTaskAction(MergeManifests.java:143)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
... 30 more
* Get more help at https://help.gradle.org
BUILD FAILED in 18s
113 actionable tasks: 110 executed, 3 up-to-date
The build scan was not published due to a configuration problem.
The Gradle Cloud Services license agreement has not been agreed to.
To agree to the license, include the following in your root project's configuration:
buildScan { licenseAgreementUrl = 'https://gradle.com/terms-of-service'; licenseAgree = 'yes' }
For more information, please see https://gradle.com/scans/help/plugin-license.
Alternatively, if you are using Gradle Enterprise, specify the server location.
For more information, please see https://gradle.com/scans/help/plugin-enterprise-config.
那么這次發(fā)現(xiàn)這種方法不行了侮东,因?yàn)檫@里可以看出來:IMKit:packageDebugResources (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 3.21 secs
后面排除來的錯(cuò)誤,
豹芯,然而那個(gè)地方基本上可以排除悄雅,ok使出殺手锏分析logs.txt文件
Help-Show logs
打開文件分析錯(cuò)誤 根據(jù)時(shí)間顯示 最下面的日志才是最靠上的信息。
我這里的解決方法是刪除如下代碼
<meta-data android:name="JPUSH_CHANNEL" android:value="developer-default"/>
<meta-data android:name="JPUSH_APPKEY" android:value="${JPUSH_APPKEY}" />
如果你看完勒,那么這句話
Manifest merger failed with multiple errors see logs
說的不是看idea.log,而是控制臺(tái)中的紅色錯(cuò)誤信息,在錯(cuò)誤位置往上翻看就能找到關(guān)鍵信息