Cannot choose between the following variants of com.pinterest:ktlint:0.41.0
See original GitHub issueI have upgraded ktlint
from 0.40.0
to 0.41.0
. However, I am getting below error when I run ./gradlew ktlintCheck
. There is no change in my config between two versions. How do I fix this? Thank you.
* What went wrong:
Execution failed for task ':loadKtlintReporters'.
> Could not resolve all files for configuration ':ktlint'.
> Could not resolve com.pinterest:ktlint:0.41.0.
Required by:
project :
> Cannot choose between the following variants of com.pinterest:ktlint:0.41.0:
- runtimeElements
- shadowRuntimeElements
All of them match the consumer attributes:
- Variant 'runtimeElements' capability com.pinterest:ktlint:0.41.0:
- Unmatched attributes:
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
- Provides org.gradle.jvm.version '8' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
- Provides org.jetbrains.kotlin.localToProject 'public' but the consumer didn't ask for it
- Provides org.jetbrains.kotlin.platform.type 'jvm' but the consumer didn't ask for it
- Variant 'shadowRuntimeElements' capability com.pinterest:ktlint:0.41.0:
- Unmatched attributes:
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.dependency.bundling 'shadowed' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
Sorry, since it is a private repo, I am posting the relative parts here.
ktlint configuration
ktlint {
android = true
enableExperimentalRules = true
ignoreFailures = false
version = "0.41.0"
filter {
exclude("**/generated/**", "**/build/**")
}
reporters {
reporter "html"
}
}
.editorconfig
# EditorConfig: http://editorconfig.org
root=true
[*]
insert_final_newline=true
disabled_rules=import-ordering,chain-wrapping,experimental:spacing-between-declarations-with-comments
[*.{kt,kts}]
max_line_length=120
[**/test/**.kt]
max_line_length=off
Working env
- ktlint version: 0.41.0
- ktlint-gradle plugin version: 10.0.0
- Gradle: 6.8.3
- Android Studio: 4.1.3
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Cannot choose between the following variants of com ... - GitHub
I have upgraded ktlint from 0.40.0 to 0.41.0. However, I am getting error when I execute ./gradlew ktlintCheck. How do I fix this?...
Read more >android - Problems running ktlint from module - Stack Overflow
Required by: project :app Cannot choose between the following variants of project :custom_ktlint_rules: - debugRuntimeElements - ...
Read more >Ktlint
ktlint aims to capture the official Kotlin coding conventions and Android Kotlin Style Guide. ... ktlint offers a standard and an experimental rule...
Read more >com.pinterest.ktlint : ktlint-reporter-html : 0.37.0 - Maven Central
ktlint -reporter-html - An anti-bikeshedding Kotlin linter with built-in formatter.
Read more >jeremymailen / ktlint Download - JitPack
ktlint recognizes the following .editorconfig properties (provided they are specified under [*. ... Supports only single blank lines between imports.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If someone want the workaroud using Kotlin DSL:
Will be included into #459 PR.