После нескольких попыток я обнаружил проблему, связанную с настройкой AndroidLint.
Потому что, когда я удалил плагин lint, я не получил никаких ошибок.
Я аннулировал кеш, удалил .gradle, добавил исправленную версию в gradle-wrapper.properties, но все равно не работает.
Это полная ошибка, которую я вижу. получение.
Код: Выделить всё
* 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
Код: Выделить всё
class AndroidLintConventionPlugin : Plugin
{
override fun apply(target: Project) {
with(target) {
when {
pluginManager.hasPlugin("com.android.application") ->
configure { lint(Lint::configure) }
pluginManager.hasPlugin("com.android.library") ->
configure { lint(Lint::configure) }
else -> {
apply(plugin = "com.android.lint")
configure(Lint::configure)
}
}
}
}
}
private fun Lint.configure() {
xmlReport = true
sarifReport = true
checkDependencies = true
disable += "GradleDependency"
}
Код: Выделить всё
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
Код: Выделить всё
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"
}
}
}
Код: Выделить всё
pluginManagement {
repositories {
gradlePluginPortal()
google()
}
}
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
}
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
rootProject.name = "build-logic"
include(":convention")

Подробнее здесь: https://stackoverflow.com/questions/794 ... ion-is-8-9
Мобильная версия