Android Studio:将字节码转换为dex时出错

问题描述 投票:1回答:1

当我开始构建应用程序时,我收到此错误

将字节码转换为dex时出错:原因:com.android.dex.DexException:多个dex文件定义Landroid / arch / lifecycle / LiveData $ 1;

这是我在build.gradle中的依赖项

dependencies {
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    /* compile('com.twitter.sdk.android:twitter:3.1.1@aar') {
        transitive = true
    }*/
    implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true
    }

    //noinspection GradleCompatible
    compile 'com.android.support:appcompat-v7:27.1.0'
    compile 'com.android.support:customtabs:27.1.0'
    compile 'com.android.support:support-v4:27.1.0'
    compile 'com.android.support:cardview-v7:27.1.0'
    compile 'com.android.support:recyclerview-v7:27.1.0'
    compile 'com.android.support:design:27.1.0'

    compile 'com.squareup.retrofit2:retrofit:2.3.0'
    compile 'com.squareup.retrofit2:converter-gson:2.3.0'

    compile 'com.squareup.okhttp3:okhttp:3.9.1'
    compile 'com.squareup.okhttp3:logging-interceptor:3.9.1'

    compile 'com.github.bumptech.glide:glide:4.6.1'

    compile 'com.android.support:multidex:1.0.3'

    compile 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

    compile 'com.google.code.gson:gson:2.8.1'
    compile 'com.facebook.android:facebook-android-sdk:4.25.0'

    compile 'com.google.firebase:firebase-auth:11.8.0'
    compile 'com.google.android.gms:play-services-auth:11.8.0'
    //noinspection UseOfBundledGooglePlayServices
    compile 'com.google.android.gms:play-services:11.8.0'
    compile 'com.google.android.gms:play-services-location:11.8.0'
    compile 'com.firebaseui:firebase-ui:2.3.0'

    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.theartofdev.edmodo:android-image-cropper:2.6.0'

    compile 'com.google.firebase:firebase-crash:11.8.0'
    compile 'com.google.firebase:firebase-perf:11.8.0'

    compile 'com.google.firebase:firebase-core:11.8.0'
    compile 'com.google.firebase:firebase-messaging:11.8.0'

    compile 'com.pusher:pusher-java-client:1.6.0'
    compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
    testCompile 'junit:junit:4.12'
}

请帮助我解决这个问题,这是我最近几天遇到的一个关键问题。

android android-studio gradle build.gradle dex
1个回答
0
投票

类似的帖子,可能有用:https://stackoverflow.com/a/21100040/6407116

© www.soinside.com 2019 - 2024. All rights reserved.