Please ignore this post. It turns out Google Play service is imported as an AAR dependency, and further looking into the AAR file, it did includes all the whole AdMob classes in its classes.jar file.
I am still trying to figure out how to resolve this conflict, but the problem is not related with build tools now. On Monday, November 17, 2014 5:02:24 PM UTC+8, Jerry Tian wrote: > > We have a fairly large and complex(multi modules, multi variants) project > with multidex enabled(with android gradle plugin 0.14.0 and later 0.14.2), > and it works fine for the past weeks. Today we wanted to integrate Google > Play service into our project, but now are stucked with this exception: > > Executing task ':app-xyz:packageAllXYZDebugClassesForMultiDex' (up-to-date >> check took 0.009 secs) due to: >> No history is available. >> :app-vanilla-android-tube:packageAllFireTubeDebugClassesForMultiDex FAILED >> :app-vanilla-android-tube:packageAllFireTubeDebugClassesForMultiDex >> (Thread[main,5,main]) completed. Took 2.81 secs. >> FAILURE: Build failed with an exception. >> * What went wrong: >> Execution failed for task >> ':app-vanilla-android-tube:packageAllFireTubeDebugClassesForMultiDex'. >> > java.util.zip.ZipException: duplicate entry: com/google/ads/AdSize.class >> * Try: >> Run with --debug option to get more log output. >> * Exception is: >> org.gradle.api.tasks.TaskExecutionException: Execution failed for task >> ':app-vanilla-android-tube:packageAllFireTubeDebugClassesForMultiDex'. >> ...... >> at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48) >> Caused by: org.gradle.internal.UncheckedException: >> java.util.zip.ZipException: duplicate entry: com/google/ads/AdSize.class >> at >> org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:39) >> at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:66) >> at >> org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218) >> at >> org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211) >> at >> org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200) >> at >> org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:579) >> at >> org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:562) >> at >> org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80) >> at >> org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61) >> ... 47 more >> Caused by: java.util.zip.ZipException: duplicate entry: >> com/google/ads/AdSize.class >> at java_util_jar_JarOutputStream$putNextEntry.call(Unknown Source) >> at >> com.android.build.gradle.internal.tasks.multidex.JarMergingTask.processJarFile(JarMergingTask.groovy:121) >> at >> com.android.build.gradle.internal.tasks.multidex.JarMergingTask.createJar(JarMergingTask.groovy:59) >> at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63) >> ... 54 more >> >> BUILD FAILED > > > At first I thought we do put some duplicated entries through some external > dependencies into our project, and dumped the dependency for our > project(listed below, by './gradlew -q dependencies' command). But after a > careful look into these entries, there is no hint of duplicated jar files > there. I even manually expand all the jars in Android Studio(see the > screenshot), but still can not find there is any duplication of the > complained ones. > > - ## Internal use, do not manually configure ## >> +--- com.android.support:multidex:1.0.0 >> +--- project :android-vtube-common >> | +--- com.android.support:multidex:1.0.0 >> | +--- com.google.android.gms:play-services:6.1.71 >> | | \--- com.android.support:support-v4:20.0.0 >> | | \--- com.android.support:support-annotations:20.0.0 >> | +--- org.teleal.cling:cling-core:1.0.6-SNAPSHOT >> | +--- org.teleal:teleal-common:1.0.13 >> | +--- net.ioncannnon:ap4j:0.0.5-SNAPSHOT >> | | \--- javax.jmdns:jmdns:3.4.1 >> | +--- commons-io:commons-io:2.4 >> | +--- org.apache.commons:commons-lang3:3.1 >> | +--- de.mindpipe.android:android-logging-log4j:1.0.3 >> | +--- log4j:log4j:1.2.16 >> | +--- com.google.code.gson:gson:2.2.2 >> | +--- com.nostra13.universalimageloader:universal-image-loader:1.8.4 >> | +--- com.google.apis:google-api-services-youtube:v3-rev116-1.19.0 >> | | \--- com.google.api-client:google-api-client:1.19.0 >> | | +--- com.google.oauth-client:google-oauth-client:1.19.0 >> | | | \--- com.google.http-client:google-http-client:1.19.0 >> | | \--- com.google.guava:guava-jdk5:13.0 >> | +--- com.google.http-client:google-http-client-gson:1.19.0 >> | | +--- com.google.http-client:google-http-client:1.19.0 >> | | \--- com.google.code.gson:gson:2.1 -> 2.2.2 >> | +--- com.android.support:support-v4:19.1.0 -> 20.0.0 (*) >> | +--- com.mopub.mobileads:mopub-sdk:1.0.0-SNAPSHOT >> | +--- com.vtube:inhouse-ad:0.1.1-SNAPSHOT >> | | +--- org.codehaus.jackson:jackson-core-asl:1.9.12 >> | | +--- org.codehaus.jackson:jackson-mapper-asl:1.9.12 >> | | | \--- org.codehaus.jackson:jackson-core-asl:1.9.12 >> | | +--- commons-io:commons-io:2.4 >> | | +--- commons-lang:commons-lang:2.3 >> | | \--- log4j:log4j:1.2.16 >> | +--- com.ihanghai:module-youtube-support:0.6.8-SNAPSHOT >> | | +--- org.luaj:luaj-jse:3.0-beta2 >> | | +--- commons-io:commons-io:2.4 >> | | \--- log4j:log4j:1.2.16 >> | +--- com.amazon:amazon-ads:5.3.17 >> | +--- com.amazon:amazon-insights-android:2.1.10 >> | +--- com.google:admob:6.4.1 >> | +--- com.inmobi:inmobi:4.1.1 >> | +--- com.flurry:flurry-agent-analytics:3.3.0 >> | +--- com.crashlytics.android:crashlytics:1.0.0 >> | +--- project :exoplayer-library >> | +--- project :facebook-android-sdk >> | | \--- com.android.support:support-v4:19.1.0 -> 20.0.0 (*) >> | \--- project :module-android-vapp-reminder >> | +--- commons-io:commons-io:2.4 >> | +--- org.apache.commons:commons-lang3:3.1 >> | \--- com.google.code.gson:gson:2.2.2 >> \--- com.amazon:in-app-purchasing:1.0.3 > > > I have looked into the code who throws the exception: > > >> https://android.googlesource.com/platform/tools/base/+/ff74addd51eade5de9b2a5d5f7b4e3cf2ee8f98e/build-system/gradle/src/main/groovy/com/android/build/gradle/internal/tasks/multidex/JarMergingTask.groovy > > > I am still left with no clue where the duplicated entry comes from, and > there is no extra debugging information available to me for the moment. Any > thoughts on how to debug this build problem? Do I need to setup a build > environment for the plugin itself, or there is some extra flags I can turn > to? > > Thanks. > > -- You received this message because you are subscribed to the Google Groups "adt-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
