引起原因:com.android.tools.r8.utils.AbortException:错误:null,无法在单个dex文件中容纳请求的类(#方法:90627> 65536)

时间:2019-09-24 11:10:06

标签: java android

当我在build.gradle文件中添加三行firebase代码时,运行应用程序时出现编译错误。

当我添加三行代码时,它给我一个错误,即API最低标签要求16,然后我更改为16。

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.example.expensemanager"
        minSdkVersion 16
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}




dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'


    **implementation 'com.google.firebase:firebase-analytics:17.2.0'
    implementation 'com.google.firebase:firebase-auth:19.0.0'
    implementation 'com.google.firebase:firebase-firestore:21.1.1'**
    implementation 'com.google.android.material:material:1.0.0'





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

我该如何解决错误编译时错误。

0 个答案:

没有答案