无法构建/运行应用程序:程序类型已存在

时间:2018-06-19 13:51:07

标签: android android-gradle android-studio-3.1.3

请帮助我解决此错误:

重复的zip条目[com / google / android / gms / internal / e / hz.class == classes.jar:com / google / android / gms / internal / measurement / zzyd.class]

  

失败:构建失败,并出现异常。

     

出了什么问题

     

执行任务失败   ':app:transformDexArchiveWithDexMergerForDebug'。

     

com.android.build.api.transform.TransformException:java.lang.RuntimeException:java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:合并dex存档时出错:E:\ Projects \ AndroidStudio \ kt \ DebtTracer \ app \ build \ intermediates \ transforms \ dexBuilder \ debug \ 0.jar   尝试:使用--stacktrace选项运行以获取堆栈跟踪。与运行   --info或--debug选项可获取更多日志输出。与--scan一起运行以获得完整的见解。

     

https://help.gradle.org

获得更多帮助      

在4m 17s内失败

应用程序模块gradle文件:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.company.appname"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        resConfigs "en", "fr"
        dexOptions {
            javaMaxHeapSize "4g"
        }
    }
    buildTypes {
        debug {
            multiDexKeepFile file('multidex-config.txt')
            multiDexKeepProguard file('multidex-config.pro')
            minifyEnabled true
            useProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        release {
            multiDexKeepFile file('multidex-config.txt')
            multiDexKeepProguard file('multidex-config.pro')
            minifyEnabled true
            useProguard true //
            shrinkResources true // 
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    buildToolsVersion '28.0.0 rc2'
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.google.firebase:firebase-auth:16.0.2'
    implementation 'com.google.firebase:firebase-messaging:17.0.0'
    implementation 'com.google.firebase:firebase-firestore:17.0.1'
    implementation 'com.google.firebase:firebase-invites:16.0.0'
    implementation 'com.google.firebase:firebase-ads:15.0.1'
    implementation 'com.google.firebase:firebase-crash:16.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.google.android.gms:play-services-wallet:15.0.1'
    implementation 'com.android.support:support-vector-drawable:27.1.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:multidex:1.0.3'
    //third party
    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
    implementation files('libs/activation.jar')
    implementation files('libs/additionnal.jar')
    implementation files('libs/mail.jar')
}

apply plugin: 'com.google.gms.google-services'

我曾尝试删除和.gradle目录,清理和重建项目,并根据某些帖子的建议检查重复的依赖项,它们似乎对我不起作用。当我在下面添加依赖项时,问题开始发生:

implementation 'com.google.android.gms:play-services-wallet:15.0.1'

但是删除它并重新构建没有它的项目仍不能解决问题。

我使用: 宏certmp455-mg, Windows 10, Android Studio 3.1.3, Gradle版本4.4, Java版本8

0 个答案:

没有答案