Included projects that bring their own xmlpullparser
always needed some extra care in Android Studio since Android brings its own xmlpullparser.
E.g. the popular XML mapper XStream
required this exclude (1) (2) :
compile('com.thoughtworks.xstream:xstream:1.4.7') {
exclude group: 'xmlpull', module: 'xmlpull' //exclude xmlpull to avoid `Multiple dex files define`-error
}
Somewhere else I also have seen:
compile('com.thoughtworks.xstream:xstream:1.4.7') {
exclude group: 'xmlpull'
exclude group: 'XmlPullParser'
}
The news on this question is: The exclude worked on Android Plugin Version 2.3.3 while on Android Plugin Version 3.0.0 I get errors again! (You can see the Android Plugin Version under File > Project Structure > Project)
Has anybody already figured out how to change the gradle file to get xstream running on Android Plugin Version 3.0.0?
It's just my suspicion that 'XStream' causes that error.
16:40:26.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 16:40:26.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception. 16:40:26.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 16:40:26.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong: 16:40:26.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. 16:40:26.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex 16:40:26.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 16:40:26.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is: 16:40:26.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. 16:40:26.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100) 16:40:26.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70) 16:40:26.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63) 16:40:26.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) 16:40:26.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) 16:40:26.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88) 16:40:26.672 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52) 16:40:26.672 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) 16:40:26.672 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) 16:40:26.672 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) 16:40:26.672 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) 16:40:26.672 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248) 16:40:26.672 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336) 16:40:26.672 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328) 16:40:26.672 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197) 16:40:26.672 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107) 16:40:26.672 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241) 16:40:26.672 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230) 16:40:26.672 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124) 16:40:26.672 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80) 16:40:26.673 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105) 16:40:26.673 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99) 16:40:26.673 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625) 16:40:26.673 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580) 16:40:26.673 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99) 16:40:26.673 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) 16:40:26.673 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) 16:40:26.673 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) 16:40:26.673 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex 16:40:26.673 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex 16:40:26.673 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:72) 16:40:26.673 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36) 16:40:26.673 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: com.android.dex.DexException: Multiple dex files define Lorg/xmlpull/mxp1/MXParser; 16:40:26.673 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661) 16:40:26.673 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616) 16:40:26.674 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598) 16:40:26.674 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171) 16:40:26.674 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at com.android.dx.merge.DexMerger.merge(DexMerger.java:198) 16:40:26.674 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61) 16:40:26.674 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] ... 1 more 16:40:26.674 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 16:40:26.674 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 16:40:26.674 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org 16:40:26.674 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] 16:40:26.674 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 37s