【问题标题】:Error converting bytecode to dex: Multiple dex files define Landroid/arch/lifecycle/LiveData$LifecycleBoundObserver;将字节码转换为dex时出错:多个dex文件定义了Landroid/arch/lifecycle/LiveData$LifecycleBoundObserver;
【发布时间】:2020-07-08 02:44:48
【问题描述】:

我已经为这个错误苦苦挣扎了太久了。我不断收到此错误

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

有人可以帮忙吗?谢谢

我的 build.gradle 文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.helpapp_ovi"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {


    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'

    implementation 'com.android.support.constraint:constraint-layout:1.1.3'

    implementation 'com.google.firebase:firebase-auth:12.0.0'
    implementation 'com.google.firebase:firebase-database:12.0.0'
    implementation 'com.google.firebase:firebase-core:12.0.0'
    implementation 'com.google.firebase:firebase-messaging:12.0.0'
    implementation 'com.google.firebase:firebase-crash:12.0.0'
    implementation 'com.google.firebase:firebase-storage:12.0.0'

    implementation 'com.firebaseui:firebase-ui-database:3.1.0'
    implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
    implementation 'com.mcxiaoke.volley:library:1.0.19'
    implementation 'com.google.code.gson:gson:2.8.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:support-vector-drawable:28.0.0'
}


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

【问题讨论】:

    标签: android android-studio dependencies android-multidex


    【解决方案1】:

    您好,请将您的依赖项更新到最新版本并添加以下内容:

    android {
      dexOptions {
        preDexLibraries = false
      }
    }
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-11-11
    • 1970-01-01
    • 2018-04-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多