运行应用程序时,任务 ':app:mergeDebugResources' 执行失败

时间:2021-07-04 12:34:25

标签: android-studio

我是 android studio 的初学者。当我尝试在手机上运行该应用程序时,android studio 向我显示此错误:

<块引用>

"任务 ':app:mergedebugresources' 的执行失败。失败 执行时发生 com.android.build.gradle.internal.res.ResourceCompilerRunnable"

我的构建 gradle(app):

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 30

    defaultConfig {
        applicationId "com.example.newlogin2"
        minSdkVersion 16
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    
    aaptOptions{
        cruncherEnabled = false
        useNewCruncher = false
    }


    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'com.google.firebase:firebase-auth:21.0.1'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

    implementation 'com.rengwuxian.materialedittext:library:2.1.4'

    implementation 'androidx.recyclerview:recyclerview:1.2.1'
    
    implementation 'androidx.recyclerview:recyclerview-selection:1.1.0'
    implementation platform('com.google.firebase:firebase-bom:28.2.0')
    implementation 'com.google.firebase:firebase-analytics'
}

有人可以帮忙吗?谢谢!

1 个答案:

答案 0 :(得分:0)

如果您遵循一些教程,请检查您的代码,然后 去 文件 -> 使缓存无效/重新启动