gpt4 book ai didi

java - 将字节码转换为 dex : Cause: com. android.dex.DexException:多个 dex 文件定义

转载 作者:行者123 更新时间:2023-12-02 11:16:41 24 4
gpt4 key购买 nike

Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Landroid/arch/lifecycle/LiveData$LifecycleBoundObserver;

我的gradle文件

android {
compileSdkVersion 27
defaultConfig {
applicationId "com.ayoubdesigner101.Sinbad.sealling"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.firebase:firebase-auth:11.0.4'
implementation 'com.google.firebase:firebase-database:11.0.4'
implementation 'com.google.firebase:firebase-crash:11.0.4'
implementation 'com.google.firebase:firebase-storage:11.0.4'
// FirebaseUI for Firebase Realtime Database
implementation 'com.firebaseui:firebase-ui-database:2.3.0'

compile 'com.google.android.gms:play-services:11.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:cardview-v7:27.1.1'
compile 'com.aurelhubert:ahbottomnavigation:2.1.0'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
compile 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.github.bumptech.glide:glide:4.6.1'
compile 'com.firebase:geofire-android:2.1.1'
}

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

**这是我得到的错误**

Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Landroid/arch/lifecycle/LiveData$LifecycleBoundObserver;
Error:com.android.dex.DexException: Multiple dex files define Landroid/arch/lifecycle/LiveData$LifecycleBoundObserver;
Error: at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661)
Error: at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616)
Error: at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598)
Error: at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
Error: at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
Error: at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
Error: at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
Error: at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
Error: at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
Error: at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
Error: at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
Error: at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Error:Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Landroid/arch/lifecycle/LiveData$LifecycleBoundObserver;
Information:BUILD FAILED in 14s
Information:15 errors
Information:0 warnings
Information:See complete output in console

最佳答案

您需要upgrade your Firebase Ui依赖关系以及 GeoFire

一旦你这样做了,ensure compatibles between it and the other Google and Firebase versions

而不是 :play-services:11.0.4,请 compile the specific dependencies of Google Play you actually are going to use 。这种依赖性是所有这些,并且它会减慢您添加不使用的库的构建速度。

如果您已将任何 JAR 文件添加到 libs 文件夹中,通常也会出现此错误。对于提到的类,该 JAR 必须是 Android 支持库,例如 Android Architecture

关于java - 将字节码转换为 dex : Cause: com. android.dex.DexException:多个 dex 文件定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50222399/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com