温馨提示:本文翻译自stackoverflow.com,查看原文请点击:java - Cannot fit requested classes in a single dex file (# methods: 86010 > 65536)
android-studio java

java - 无法将请求的类放入单个dex文件中(#方法:86010> 65536)

发布于 2020-03-27 15:52:12

我不知道错误是什么意思。我正在尝试使用youtube做一个使用Firebase的uber应用,并收到此错误。

无法在单个dex文件中放入请求的类(#方法:86010> 65536)com.android.tools.r8.CompilationFailedException:编译无法完成。

build.gradle(应用程序)

    apply plugin: 'com.android.application'
    apply plugin: 'com.google.gms.google-services'
    android {
        compileSdkVersion 28
        buildToolsVersion "29.0.2"
        defaultConfig {
            applicationId "com.example.ezbusjava"
            minSdkVersion 16
            targetSdkVersion 28
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
                debuggable = true
                signingConfig signingConfigs.debug
            }
        }
    }
    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation 'androidx.appcompat:appcompat:1.1.0'
        implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
        implementation 'com.google.firebase:firebase-analytics:17.2.2'
        implementation 'com.google.firebase:firebase-auth:19.2.0'
        implementation 'com.google.firebase:firebase-firestore:21.3.1'
        implementation 'com.google.firebase:firebase-database:19.2.0'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'androidx.test.ext:junit:1.1.1'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    }

build.gradle(项目)

buildscript {
    repositories {
        mavenCentral()
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'
        classpath 'com.google.gms:google-services:4.3.3'
    }
}

allprojects {
    repositories {
        mavenCentral()
        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

查看更多

查看更多

提问者
PhilipJNC
被浏览
48
Jude Osbert K 2020-01-31 16:44

尝试在应用程序中启用Multidex。您可以在这里阅读有关它的更多信息https://developer.android.com/studio/build/multidex