Gradle project sync failed

You k2 years ago

hello,

i got this error while sync project with gradle files for the first time on android studio flamingo newest version
here some details regarding te config
Gradle properties :

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

Build.gradle :

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
        classpath 'com.google.gms:google-services:4.3.15'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.4'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
You k2 years ago

error :

Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin 'com.android.internal.application'.
Anton Tananaev2 years ago

There has to be a more detailed error somewhere.

You k2 years ago

Hello,

please do you know what should i change ? i'm facing this error while trying to generate a signed apk

'compileGoogleReleaseJavaWithJavac' task (current target is 1.8) and 'compileGoogleReleaseKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version

here is my build.gradle :

buildscript {
    ext.kotlin_version = '1.8.0'
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.0.2'
        classpath 'com.google.gms:google-services:4.3.15'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.5'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}
You k2 years ago

i'm using the last version of android studio flamingo