android - Minimum supported Gradle version is 8.10.2. Current version is 8.9? - Stack Overflow

admin2025-04-17  4

I'm facing this issue where i'm trying to update gradle version in my multi-module jetpack compose. When i build project and run it on my physical device it runs without any error. This error occurs when i "Clean Project".

After couples of of tries i found the issue related to AndroidLint setup. cause when i deleted the lint plugin i didn't get any errors.

I invalidated cache, delete .gradle, added corrected version to gradle-wrapper.properties but still not working.

This the full error i'm getting.

* What went wrong:
An exception occurred applying plugin request [id: 'com.android.lint', version: '8.8.0']
> Failed to apply plugin 'com.android.internal.version-check'.
> Minimum supported Gradle version is 8.10.2. Current version is 8.9. 
If using the gradle wrapper, try editing the distributionUrl in 
C:\Users\Lenovo\AndroidStudioProjects\SpotifyClone\build-logic\gradle\wrapper\gradle-wrapper.properties to gradle-8.10.2-all.zip

this is AndroidLintConventionPlugin

class AndroidLintConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
    with(target) {
        when {
            pluginManager.hasPlugin("com.android.application") ->
                configure<ApplicationExtension> { lint(Lint::configure) }

            pluginManager.hasPlugin("com.android.library") ->
                configure<LibraryExtension> { lint(Lint::configure) }

            else -> {
                apply(plugin = "com.android.lint")
                configure<Lint>(Lint::configure)
            }
        }
    }
}
}

private fun Lint.configure() {
  xmlReport = true
  sarifReport = true
  checkDependencies = true
  disable += "GradleDependency"
}

This is the gradle-wrapper.properties of full project.

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle/distributions/gradle-8.10.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

This the build.gradle.kts in my build-logic

import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
  `kotlin-dsl`
   alias(libs.plugins.android.lint)
}

group = "com.example.spotifyclone.buildlogic"

java {
    sourceCompatibility = JavaVersion.VERSION_17
    targetCompatibility = JavaVersion.VERSION_17
}

kotlin{
   compilerOptions {
       jvmTarget = JvmTarget.JVM_17
    }
}

dependencies {
    compileOnly(libs.android.gradlePlugin)
    compileOnly(libs.android.toolsmon)
    compileOnly(libspose.gradlePlugin)
    compileOnly(libs.kotlin.gradlePlugin)
    compileOnly(libs.ksp.gradlePlugin)
    lintChecks(libs.androidx.lint.gradle)
}

tasks {
    validatePlugins {
        enableStricterValidation = true
        failOnWarning = true
    }
}


gradlePlugin {
   plugins {
      register("androidApplicationCompose") {
          id = "spotify.android.applicationpose"
          implementationClass = "AndroidApplicationComposeConventionPlugin"
      }
    register("androidApplication") {
        id = "spotify.android.application"
        implementationClass = "AndroidApplicationConventionPlugin"
    }
    register("androidLibraryCompose") {
        id = "spotify.android.librarypose"
        implementationClass = "AndroidLibraryComposeConventionPlugin"
    }
    register("androidLibrary") {
        id = "spotify.android.library"
        implementationClass = "AndroidLibraryConventionPlugin"
    }
    register("androidFeature") {
        id = "spotify.android.feature"
        implementationClass = "AndroidFeatureConventionPlugin"
    }
    register("androidHilt") {
        id = "spotify.android.hilt"
        implementationClass = "AndroidHiltConventionPlugin"
    }
    register("androidLint") {
        id = "spotify.android.lint"
        implementationClass = "AndroidLintConventionPlugin"
    }
}
}

This is my settings.gradle.kts in my build-logic

pluginManagement {
   repositories {
    gradlePluginPortal()
    google()
   }
}
dependencyResolutionManagement {
   repositories {
      google()
      mavenCentral()
   }
   versionCatalogs {
       create("libs") {
          from(files("../gradle/libs.versions.toml"))
       }
   }
}

rootProject.name = "build-logic"
include(":convention")

I'm facing this issue where i'm trying to update gradle version in my multi-module jetpack compose. When i build project and run it on my physical device it runs without any error. This error occurs when i "Clean Project".

After couples of of tries i found the issue related to AndroidLint setup. cause when i deleted the lint plugin i didn't get any errors.

I invalidated cache, delete .gradle, added corrected version to gradle-wrapper.properties but still not working.

This the full error i'm getting.

* What went wrong:
An exception occurred applying plugin request [id: 'com.android.lint', version: '8.8.0']
> Failed to apply plugin 'com.android.internal.version-check'.
> Minimum supported Gradle version is 8.10.2. Current version is 8.9. 
If using the gradle wrapper, try editing the distributionUrl in 
C:\Users\Lenovo\AndroidStudioProjects\SpotifyClone\build-logic\gradle\wrapper\gradle-wrapper.properties to gradle-8.10.2-all.zip

this is AndroidLintConventionPlugin

class AndroidLintConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
    with(target) {
        when {
            pluginManager.hasPlugin("com.android.application") ->
                configure<ApplicationExtension> { lint(Lint::configure) }

            pluginManager.hasPlugin("com.android.library") ->
                configure<LibraryExtension> { lint(Lint::configure) }

            else -> {
                apply(plugin = "com.android.lint")
                configure<Lint>(Lint::configure)
            }
        }
    }
}
}

private fun Lint.configure() {
  xmlReport = true
  sarifReport = true
  checkDependencies = true
  disable += "GradleDependency"
}

This is the gradle-wrapper.properties of full project.

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

This the build.gradle.kts in my build-logic

import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
  `kotlin-dsl`
   alias(libs.plugins.android.lint)
}

group = "com.example.spotifyclone.buildlogic"

java {
    sourceCompatibility = JavaVersion.VERSION_17
    targetCompatibility = JavaVersion.VERSION_17
}

kotlin{
   compilerOptions {
       jvmTarget = JvmTarget.JVM_17
    }
}

dependencies {
    compileOnly(libs.android.gradlePlugin)
    compileOnly(libs.android.tools.common)
    compileOnly(libs.compose.gradlePlugin)
    compileOnly(libs.kotlin.gradlePlugin)
    compileOnly(libs.ksp.gradlePlugin)
    lintChecks(libs.androidx.lint.gradle)
}

tasks {
    validatePlugins {
        enableStricterValidation = true
        failOnWarning = true
    }
}


gradlePlugin {
   plugins {
      register("androidApplicationCompose") {
          id = "spotify.android.application.compose"
          implementationClass = "AndroidApplicationComposeConventionPlugin"
      }
    register("androidApplication") {
        id = "spotify.android.application"
        implementationClass = "AndroidApplicationConventionPlugin"
    }
    register("androidLibraryCompose") {
        id = "spotify.android.library.compose"
        implementationClass = "AndroidLibraryComposeConventionPlugin"
    }
    register("androidLibrary") {
        id = "spotify.android.library"
        implementationClass = "AndroidLibraryConventionPlugin"
    }
    register("androidFeature") {
        id = "spotify.android.feature"
        implementationClass = "AndroidFeatureConventionPlugin"
    }
    register("androidHilt") {
        id = "spotify.android.hilt"
        implementationClass = "AndroidHiltConventionPlugin"
    }
    register("androidLint") {
        id = "spotify.android.lint"
        implementationClass = "AndroidLintConventionPlugin"
    }
}
}

This is my settings.gradle.kts in my build-logic

pluginManagement {
   repositories {
    gradlePluginPortal()
    google()
   }
}
dependencyResolutionManagement {
   repositories {
      google()
      mavenCentral()
   }
   versionCatalogs {
       create("libs") {
          from(files("../gradle/libs.versions.toml"))
       }
   }
}

rootProject.name = "build-logic"
include(":convention")

Share Improve this question edited Feb 3 at 11:12 Fatima Jamal asked Jan 30 at 19:17 Fatima JamalFatima Jamal 1671 silver badge9 bronze badges 2
  • Is that a line break separating gradle and 8.10.2-all.zip? Please edit your question to provide the exact content of your gradle-wrapper.properties. And shouldn't it be bin instead of all? I'm not sure if that matters, though. – tyg Commented Jan 30 at 19:37
  • @tyg i tried both bin, all but still face same problem, – Fatima Jamal Commented Jan 30 at 19:58
Add a comment  | 

3 Answers 3

Reset to default 0

Your distributionUrl is incorrectly formatted. Update your gradle-wrapper.properties file to:

distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip

Make sure there's no extra space or line break in the URL

PS: I usually go with -bin.zip because it's smaller and has everything needed to run Gradle builds. But if you want local documentation or Gradle source code for debugging, -all.zip (the one you're currently using) includes that.

I'm experiencing the same problem.

I think it's the same problem referenced here: https://github.com/jjohannes/idiomatic-gradle/issues/5

It seems that Android Studio is spawning a different daemon for the included build, which seems to be the bundled one (8.9 atm) instead of using the one defined in the main project.

The workaround, as described in that post, is to put a gradle/wrapper/gradle-wrapper.properties inside the included build with the same distributionUrl as the one in the main project.

I also think it's related to this: https://issuetracker.google.com/issues/212674413, and maybe this: https://github.com/gradle/gradle/issues/2534. Who knows.

Try bumping gradle to version 8.12.1. It solved similar issue in my case. Good luck.

https://docs.gradle.org/8.12.1/release-notes.html

转载请注明原文地址:http://anycun.com/QandA/1744895231a89143.html