构建我的 android 项目时出现无法合并 dex 错误

Unable to merge dex error when building my android project

我正在尝试构建我的 android 项目并遇到错误 "Unable to merge dex"

我尝试了其他帖子中提到的不同选项。其中一些是

问题仍然存在,我不确定哪里出了问题。请分享您的想法。

Error:Execution failed for task         
':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: 
com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

我的 app/build.gradle 文件

            apply plugin: 'com.android.application'

            android {
                compileSdkVersion 27

                defaultConfig {
                    applicationId "app.resta.com.restaurantapp"
                    minSdkVersion 23
                    targetSdkVersion 27
                    versionCode 1
                    versionName "1.0"
                    multiDexEnabled true
                }
                buildTypes {
                    release {
                        minifyEnabled false
                        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                    }
                }
                compileOptions {
                    targetCompatibility 1.7
                    sourceCompatibility 1.7
                }
            }
            repositories {
                maven { url "https://jitpack.io" }
            }
            dependencies {
                compile fileTree(dir: 'libs', include: ['*.jar'])
                testCompile 'junit:junit:4.12'
                implementation 'com.android.support:appcompat-v7:27.0.2'
                implementation 'com.android.support:design:27.0.2'
                implementation 'com.android.support:recyclerview-v7:27.0.2'

                compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'
                implementation 'com.google.firebase:firebase-core:16.0.6'
                implementation 'com.google.firebase:firebase-firestore:17.1.5'
                implementation 'com.google.firebase:firebase-storage:16.0.5'
                implementation 'com.firebaseui:firebase-ui-storage:4.1.0'
                annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
                implementation 'com.android.support:multidex:1.0.3'
            }

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

使用支持库 27.1.1 构建:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.2'
    implementation 'com.google.firebase:firebase-core:16.0.6'
    implementation 'com.google.firebase:firebase-firestore:17.1.5'
    implementation 'com.google.firebase:firebase-storage:16.0.5'
    implementation 'com.firebaseui:firebase-ui-storage:4.1.0'
    implementation 'com.android.support:multidex:1.0.3'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
    testImplementation 'junit:junit:4.12'
}

如果没有,请添加整个 DexArchiveMergerException 而不仅仅是那条通知,它什么也没说。