Android: ошибка при генерации основного списка dex - PullRequest
0 голосов
/ 16 сентября 2018

Я получил эту ошибку после добавления другого пакета для PayPal, но я удалил эту ошибку, и я все еще получаю ту же ошибку, я проверил несколько решений для этой проблемы, и она еще не была решена.код gradle был прикреплен ниже.

Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.

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'

Ответы [ 2 ]

0 голосов
/ 07 января 2019

Я решил это, увеличив minsdkversion до 21. Надеюсь, это кому-нибудь поможет

0 голосов
/ 17 сентября 2018

Файл, который вы указываете в multiDexKeepFile, должен содержать один класс на строку в формате com / example / MyClass.class. Например, вы можете создать файл с именем multidex-config.txt, который выглядит следующим образом:

com/example/MyClass.class
com/example/MyOtherClass.class

Затем вы можете объявить этот файл для типа сборки следующим образом:

android {
    buildTypes {
        release {
            multiDexKeepFile file('multidex-config.txt')
            ...
        }
    }
}
...