-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot choose between the following variants #600
Comments
Well, I don't know if it is a reason why it doesn't work, but the plugin doesn't support ktlint 0.46.0+ #589 |
Changed the ktlint version from 0.46.1 to 0.42.1. The error continue. |
I've seen this semi-recently with someone that moved to kotlin 1.7 but the build toolchain (gradle / gradle-plugin) was not latest versions. Pretty vague comment (and it was vague when I last saw it as well). Backing it down to 1.6.x kotlin worked. I suppose updating gradle / gradle plugin to current stable would also work It's roughly this https://stackoverflow.com/questions/73342537/cannot-use-kotlin-1-7-10 |
Thanks for your suggestion @mikehardy. I tried first to downgrade the kotlin version to 1.6.10. Then next, I tried with kotlin version 1.6.10 and the last version of gradle / gradle plugin (7.5.1 / 7.2.2). Then, on my last try, the kotlin and the gradle / gradle plugin with the last stable version. Unfortunately, it doesn't work :( |
Oh I'm sorry to hear that, I dug around for the related issue but couldn't find it - anyway it was definitely reproducible there and had a similar error message so I thought it might rhyme and the same fix would work. Looks like this inability to choose has multiple sources. I imagine we'll both learn something if someone else can nail it. Best of luck with your project |
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? |
I'm trying to create a custom rule using Ktlint on a multi-module project. For that, I created a new module just for custom rules. This module is with this configuration:
I created the custom rule:
And the RuleSetProvider:
Then, registered creating a file with the name
com.pinterest.ktlint.core.RuleSetProvider
on the path/src/main/res/META-INF/services
. The content of this file is the path for my CustomRuleSetProvider:My root build.gradle:
And on my build.gradle from the app I included this:
When I run the command
./gradlew ktlintcheck
show this error:My environment
Ktlint version: 0.46.1
Ktlint gradle plugin version: 10.3.0
Gradle version: 7.3.3
Gradle plugin version: 7.2.1
The text was updated successfully, but these errors were encountered: