Open Jadyli opened 1 year ago
Same here. Trying to integrate ktlint gradle
in this template (multi-module branch) following the doc, into the root build.gradle. Getting the same error. Would appreciate some help.
you will need com.android.application
in your project gradle.
plugins {
id("com.android.application") version "7.4.1" apply false
id("org.jlleitschuh.gradle.ktlint") version "9.4.1" apply false
}
version 12.1.0 of ktlint gradle came with fixes around AGP >= 7.0. Can you please retry with this version and report if it resolves your issue? Thanks
Having the same issue with version 12.1.1
even.
buildSrc/settings.gradle.kts
:
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
buildSrc/build.gradle.kts
:
plugins {
`kotlin-dsl`
}
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
dependencies {
implementation(libs.gradlePlugin.ktlint)
}
buildSrc/src/main/kotlin/...gradle.kts
:
plugins {
id("org.jlleitschuh.gradle.ktlint")
}
libs.versions.toml
:
...
[libraries]
gradlePlugin-ktlint = "org.jlleitschuh.gradle:ktlint-gradle:12.1.1"
...
ktlint gradle version: 11.0.0 agp version: 7.2.2 gradle version: gradle-7.5.1-bin
After removing ktlint, the project can run sync and build normally.