简体   繁体   English

将字节码转换为dex:原因:com.android.dex.DexException:定义了多个dex文件

[英]converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define

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

my gradle file 我的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'`

**this is the error I get it ** **这是我得到的错误**

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

You need to upgrade your Firebase Ui dependencies as well as GeoFire 您需要升级Firebase Ui依赖项以及GeoFire

And once you do, ensure compatibles between it and the other Google and Firebase versions 完成后,请确保它与其他Google版本和Firebase版本之间兼容

And rather than :play-services:11.0.4 , please compile the specific dependencies of Google Play you actually are going to use . 而不是:play-services:11.0.4 ,请编译您实际要使用的Google Play的特定依赖项 That dependency is all of them, and it slows down your build adding libraries you're not using. 依赖关系就是所有这些依赖关系,这会减慢您添加不使用的库的构建速度。

This error also typically appears if you've added any JAR files into your libs folder. 如果已将任何JAR文件添加到libs文件夹中,通常也会出现此错误。 For the mentioned class, that JAR would have to be a android support library such as Android Architecture 对于上述类,该JAR必须是一个android支持库,例如Android Architecture

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将字节码转换为dex时出错:原因:com.android.dex.DexException:多个dex文件定义了Lcom / RNFetchBlob / RNFetchBlobConst; - Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/RNFetchBlob/RNFetchBlobConst; 错误:将字节码转换为dex时出错:原因:com.android.dex.DexException:多个dex文件定义了Lcom / google / android / gms / common / api / zza; - Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/common/api/zza; Gradle 构建错误将字节码转换为 dex 时出错:原因:com.android.dex.DexException:多个 dex 文件定义 Landroid/arch/lifecycle/liveData$1 - Gradle build error Error converting bytecode to dex:Cause: com.android.dex.DexException:Multiple dex files define Landroid/arch/lifecycle/liveData$1 com.android.dex.DexException:多个dex文件定义了Lcom / google / android / gms / location / places / PlaceReport; - com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/location/places/PlaceReport; 错误:com.android.dex.DexException:多个dex文件定义了Ledu / umd / cs / findbugs / annotations / NonNull; - Error:com.android.dex.DexException: Multiple dex files define Ledu/umd/cs/findbugs/annotations/NonNull; com.android.dex.DexException:多个dex文件定义了Lcom / facebook / internal / Utility $ GraphMeRequestWithCacheCallback; - com.android.dex.DexException: Multiple dex files define Lcom/facebook/internal/Utility$GraphMeRequestWithCacheCallback; com.android.dex.DexException:多个dex文件定义Lorg / hamcrest / Description; - com.android.dex.DexException: Multiple dex files define Lorg/hamcrest/Description; 意外的顶级异常:com.android.dex.DexException:多个dex文件定义 - UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define 意外的顶级异常:com.android.dex.DexException:多个dex文件定义 - UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define 未知源文件:com.android.dex.DexException:多个dex文件定义了Lcom / google / android / gms / internal / zzpq; - Unknown source file : com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzpq;
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM