Android:生成主 dex 列表时出错

Gam*_*200 1 android gradle android-studio android-multidex

我在为 paypal 添加另一个包后收到此错误,但我已删除此错误,但仍然收到相同的错误,我已针对此问题检查了多个解决方案,但尚未解决。gradle 代码已附在下面。

Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
Run Code Online (Sandbox Code Playgroud)

com.android.build.api.transform.TransformException:生成主 dex 列表时出错。

apply plugin: 'com.android.application'


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

}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support:support-v4:26.1.0'
    //noinspection GradleCompatible
    implementation 'com.google.firebase:firebase-config:11.0.4'
    implementation 'com.google.firebase:firebase-database:11.0.4'
    implementation 'com.google.firebase:firebase-auth:11.0.4'
    implementation 'com.google.firebase:firebase-storage:11.0.4'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'com.google.firebase:firebase-messaging:11.0.4'
    implementation 'com.firebaseui:firebase-ui:3.2.2'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.github.barteksc:android-pdf-viewer:3.0.0-beta.5'
    implementation 'com.paypal.sdk:paypal-android-sdk:2.16.0'
    implementation 'com.craftman.cardform:cardform:0.0.2'
    testImplementation 'junit:junit:4.12'
}
    apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)

Mah*_*jan 5

我通过将 minsdkversion 增加到 21 解决了这个问题。希望这会对某人有所帮助