Сбой выполнения задачи ‘: app: javaPreCompileDebug’. > Сборка отменена при выполнении задачи ‘: app: javaPreCompileDebug’

#android #android-studio #gradle

#Android #android-studio #gradle

Вопрос:

Подробная информация о выходе сборки:

 FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:javaPreCompileDebug'.
> Build cancelled while executing task ':app:javaPreCompileDebug'

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Build cancelled while executing task ':app:processDebugResources'

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 7s
12 actionable tasks: 6 executed, 6 up-to-date
 

build.gradle(:app)

 
apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

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

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.20"

    //noinspection GradleCompatible
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'

    implementation 'com.google.android.material:material:1.2.1' //1

    implementation 'androidx.legacy:legacy-support-v4:1.0.0' //2

    implementation 'com.google.firebase:firebase-auth:20.0.1'
    implementation 'com.google.firebase:firebase-database:19.5.1'
    implementation 'com.google.firebase:firebase-storage:19.2.0'
    implementation 'com.firebaseui:firebase-ui-database:4.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    implementation 'com.github.bumptech.glide:glide:4.8.0'
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'com.google.firebase:firebase-core:18.0.0'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
}

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

Ответ №1:

Попробуйте скомпилировать gradle с этим вверху:

 apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
 

также удалите этот плагин внизу (почему он вообще там? все плагины находятся вверху)

также это выглядит как незавершенная реализация чего-то не похожего на плагин:

 com.google.gms.google-services