Android 错误:任务';的执行失败:应用程序:TransformClasses with Jarmergingfordebug';。

Android 错误:任务';的执行失败:应用程序:TransformClasses with Jarmergingfordebug';。,android,android-studio,Android,Android Studio,我在尝试运行项目时出错 错误:任务“:app:transformClassesWithJarMergingForDebug”的执行失败 com.android.build.api.transform.TransformException:java.util.zip.zipeException: 重复条目:com/google/android/gms/common/internal/zzc.class build.gradle文件: android { compileSdkVersion

我在尝试运行项目时出错

错误:任务“:app:transformClassesWithJarMergingForDebug”的执行失败

com.android.build.api.transform.TransformException:java.util.zip.zipeException: 重复条目:com/google/android/gms/common/internal/zzc.class

build.gradle文件:

android {
    compileSdkVersion rootProject.ext.compileSdkVersion 
    buildToolsVersion rootProject.ext.buildToolsVersion
    packagingOptions 
    {
     exclude 'META-INF/DEPENDENCIES'
     exclude 'META-INF/NOTICE'
     exclude 'META-INF/LICENSE'
     exclude 'META-INF/LICENSE.txt'
     exclude 'META-INF/NOTICE.txt'
    }

aaptOptions {
    cruncherEnabled = false
}

dexOptions {
    preDexLibraries = false
    incremental true
    javaMaxHeapSize "4g"
}
}

dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile project(':bottom-bar')
        compile project(':cropper')
}androidTestCompile('com.android.support.test.espresso:espressocore:2.2.2',
     {
       exclude group: 'com.android.support', module: 'support-annotations'
     })

        testCompile "junit:junit:${rootProject.ext.junitVersion}"

// Multidex
    compile 'com.android.support:multidex:1.0.1'

    compile "com.android.support:appcompat- v7:${rootProject.ext.supportLibraryVersion}"
    compile    "com.android.support:design:${rootProject.ext.supportLibraryVersion}"

// RecyclerView
    compile "com.android.support:recyclerview-v7:${rootProject.ext.supportLibraryVersion}"
// CardView
    compile "com.android.support:cardview-  v7:${rootProject.ext.supportLibraryVersion}"

    compile 'com.google.android.gms:play-services:9.0.0'

// Firebase
    compile 'com.google.firebase:firebase-messaging:11.0.2'
    compile 'com.google.firebase:firebase-core:11.0.2'
    compile 'com.google.firebase:firebase-database:11.0.2'

// Butterknife
    compile 'com.jakewharton:butterknife:8.4.0'
    apt 'com.jakewharton:butterknife-compiler:8.4.0'

// Design Compatibility for all resolution
    compile 'com.intuit.sdp:sdp-android:1.0.3'

// Retrofit API cals
    compile 'com.google.code.gson:gson:2.6.2'
    compile 'com.squareup.retrofit2:retrofit:2.0.2'
    compile 'com.squareup.retrofit2:converter-gson:2.0.2'
    compile 'com.squareup.okhttp3:logging-interceptor:3.3.0'

// Picaso Image loading
    compile 'com.squareup.picasso:picasso:2.5.0'

// Realm db inplace of SQlite
    compile 'io.realm:realm-android:0.82.1'}
如果需要其他信息,请告诉我。 谢谢。

试试这个

packagingOptions 
{
  exclude 'META-INF/DEPENDENCIES'
  exclude 'META-INF/NOTICE'
  exclude 'META-INF/LICENSE'
  exclude 'META-INF/LICENSE.txt'
  exclude 'META-INF/NOTICE.txt'
  pickFirst  'META-INF/license.txt'
}

更新此编译'com.google.android.gms:play services:11.0.2'我确实尝试过,但它出现了另一个错误检查我的ans…在项目结构的libs文件夹中是否有google play库?错误是说您添加了google play services两次
Remove this line 

compile 'com.google.android.gms:play-services:9.0.0' add plugin after dependency block  

like this
dependencies {
 //your dependencies here
}apply plugin: 'com.google.gms.google-services'

and add this line in application build.gradle **classpath 'com.google.gms:google-services:3.0.0'**

Ex:
buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'
    classpath 'com.google.gms:google-services:3.0.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}