【问题标题】:Execution failed for task ':app:mergeDebugResources' occur while running the app运行应用程序时任务“:app:mergeDebugResources”执行失败
【发布时间】:2021-07-04 12:34:25
【问题描述】:

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

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

我的构建 gradle(应用程序):

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'
}

有人可以帮忙吗?谢谢!

【问题讨论】:

    标签: android-studio


    【解决方案1】:

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

    【讨论】:

    • 感谢您的回复,我试过了还是不行。(但是构建的时间比较快)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-11
    • 2017-11-09
    相关资源
    最近更新 更多