将字节码转换为 dex 时出错:多个 dex 文件定义 Landroid/arch/lifecycle/LiveData$LifecycleBoundObserver;
Error converting bytecode to dex: Multiple dex files define Landroid/arch/lifecycle/LiveData$LifecycleBoundObserver;
我已经为这个错误苦苦挣扎了太久。我不断收到此错误
错误:将字节码转换为 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 {
dexOptions {
preDexLibraries = false
}
}
我已经为这个错误苦苦挣扎了太久。我不断收到此错误
错误:将字节码转换为 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 {
dexOptions {
preDexLibraries = false
}
}