构建APK错误?

时间:2017-07-28 10:38:47

标签: android gradle

我试图构建apk它出来了。我该怎么办?请帮忙!!

我不知道问题出在哪里。我构建项目时项目很好,但是当我构建apk时出现错误。

  

错误:执行失败   任务 ':应用程序:transformClassesWithJarMergingForDebug'

。      

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / google / android / gms / auth / api / signin / internal / zzf.class

这是gradle文件

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion '25.0.0'

defaultConfig {
    applicationId 'com.androidbelieve.SeeDate'
    minSdkVersion 19
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
    useLibrary 'org.apache.http.legacy'
    multiDexEnabled true
}
packagingOptions {
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/LGPL2.1'
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
repositories {
    jcenter {
        url "http://jcenter.bintray.com/"
    }
}
productFlavors {
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services-ads:10.0.1'
compile 'com.android.support:design:22.2.1'
compile 'com.android.support:cardview-v7:22.2.1'
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.mcxiaoke.volley:library:1.0.18'
compile 'com.github.bumptech.glide:glide:3.6.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.android.support:support-v4:22.2.1'
compile 'it.neokree:MaterialNavigationDrawer:1.3.3'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.google.code.findbugs:jsr305:2.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.firebase:firebase-client-android:2.5.0'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.firebaseui:firebase-ui:0.6.0'
}
apply plugin: 'com.google.gms.google-services'

gradle项目

buildscript {
repositories {
    jcenter()
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.3.3'

    classpath 'com.google.gms:google-services:3.1.0'

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

allprojects {
repositories {
    jcenter()
}
}

2 个答案:

答案 0 :(得分:0)

您是否在Android Studio菜单中尝试了构建/清理项目

答案 1 :(得分:0)

app:transformClassesWithJarMergingForDebug来自哪个依赖?也许您应该修改该依赖项的版本号以与主要的sdk版本保持一致。