我在测试时实现应用程序显示池边错误:
错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败。 com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / google / android / gms / ads / AdActivity.class 块引用
我的日志complet:
Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72300Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42300Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAdsLite920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuth920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuthBase920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCastFramework920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesClearcut920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesContextmanager920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGass920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIid920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlaces920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanager920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerApi920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTasks920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesVision920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet920Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalytics920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuth920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthCommon920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthModule920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCommon920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseConfig920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCrash920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabase920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabaseConnection920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseIid920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseMessaging920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorage920Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorageCommon920Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:prePackageMarkerForDebug
:app:transformClassesWithJarMergingForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/ads/AdActivity.class
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 10.805 secs
我的傻瓜:
apply plugin:'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '24.0.0'
defaultConfig {
applicationId "com.myapp.app"
minSdkVersion 14
targetSdkVersion 24
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "4g"
incremental true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}
dependencies
{
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:multidex:1.0.1'
compile files('libs/apache-mime4j-core-0.7.2.jar')
compile files('libs/httpclient-4.3.6.jar')
compile files('libs/httpcore-4.3.3.jar')
compile files('libs/httpmime-4.3.6.jar')
compile files('libs/gcm.jar')
compile('com.google.android.gms:play-services:9.2.0') {
exclude group: 'com.android.support', module: 'support-v4'
}
compile 'com.android.support:appcompat-v7:21.1.2'
compile 'com.android.support:support-v4:24.0.0'
compile 'com.google.android.gms:play-services-gcm:9.2.0'
}