【问题标题】:Cannot fit requested classes in a single dex file. Try supplying a main-dex list. # methods: 87928 > 65536无法在单个 dex 文件中容纳请求的类。尝试提供一个 main-dex 列表。 # 方法:87928 > 65536
【发布时间】:2020-02-03 10:56:58
【问题描述】:

主要是什么以及如何修复错误

无法在单个 dex 文件中容纳请求的类。尝试提供一个 主索引列表。

方法:87928 > 65536

这是我的毕业作品

apply plugin: 'com.android.application'
android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.apoce.app.admin"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:customtabs:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:animated-vector-drawable:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.google.firebase:firebase-auth:16.0.3'
    implementation 'com.google.firebase:firebase-database:16.0.2'
    implementation 'com.google.firebase:firebase-core:16.0.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
    implementation 'com.facebook.android:facebook-login:[4,5)'
    implementation 'com.firebaseui:firebase-ui:4.1.0'
    implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
    implementation 'com.facebook.android:facebook-android-sdk:4.36.1'
}
apply plugin: 'com.google.gms.google-services'

【问题讨论】:

标签: android gradle


【解决方案1】:

我通过将此依赖项添加到 gardle 应用程序来修复此错误

implementation "androidx.multidex:multidex:2.0.1"

这个配置multiDexEnabled truedefaultConfig

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-06-23
    • 2018-09-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多