After upgrade to Kotlin 1.3.30 ktlint doesn't work and crash with exception
Exception in thread "main" java.lang.NoSuchFieldError: PROPERTY_DELEGATE
at com.github.shyiko.ktlint.core.ast.ElementType.<clinit>(ElementType.kt:33)
at com.github.shyiko.ktlint.ruleset.standard.ChainWrappingRule.<init>(ChainWrappingRule.kt:36)
at com.github.shyiko.ktlint.ruleset.standard.StandardRuleSetProvider.get(StandardRuleSetProvider.kt:12)
at com.github.shyiko.ktlint.Main.main(Main.kt:310)
We have exactly the same issue :(
@kirich1409 or @nzakharchenko can you submit a small sample project to reproduce the issue?
@shashachu I believe #376 fixes this. But is there a following patch release coming with the new executable and new kotlin version?
@rom4ek I wasn't clear if they were the same issue as #376 didn't change anything about PROPERTY_DELEGATE, which is why I wanted a test case.
But to answer your question, assuming this fixes the issue we can make a minor release.
@shashachu Thanks for the answer! Looking at this, I assume it just got resolved by re-compiling with the newer kotlin version, since the public type has changed. Also afaik when you do mvn clean verify, it also runs ktlint over itself, so the build on the PR would've failed, if this was an issue.
@rom4ek there are some housekeeping items that we need to do on the Pinterest side before we can make a next official release - I'll throw up a snapshot for people that want to get locally unblocked.
Should be fixed with https://github.com/pinterest/ktlint/pull/376
Thank you @shashachu!
Is the maven artifact published anywhere? I'd try to jitpack it myself, but the build isn't compatible
https://jitpack.io/com/github/shyiko/ktlint/0.31.0-SNAPSHOT/build.log
@shashachu @jeremymailen Could it be related to the point that the project owner was changed? On Jitpack I've found 0.31.0-SNAPSHOT version under this URL - com.github.pinterest:ktlint:0.31.0-SNAPSHOT
https://jitpack.io/#pinterest/ktlint/0.31.0-SNAPSHOT
Oh, of course @nzakharchenko!
Although it still has the same build problem so can't be jitpacked:
https://jitpack.io/com/github/pinterest/ktlint/0.31.0-SNAPSHOT/build.log
I'm not sure that this is the cause of the issue, but I feel like this should be also switched from shyiko to pintereset :)
@rom4ek yeah, looks like that.
Yes, we're kind of figuring out everything as we go along; thanks for bearing with us. Stanley left a great handoff doc but there's all these little details here and there that need to be updated. I think maybe I didn't set the version properly for the snapshot. I'll take a look in a bit.
Actually looks like it's been failing with that error for some time now: https://jitpack.io/com/github/shyiko/ktlint/0.29.0/build.log
It turns out jitpack just gets confused by the presence of gradle build files.
I've fixed it here: https://github.com/pinterest/ktlint/pull/384
fyi @jeremymailen and others: with the 0.32.0 release we are going to be changing the groupId from com.github.shyiko -> com.github.pinterest. I know this will be a bit disruptive for people but we figured it's better to just rip off the bandaid now. Targeting today for the release.
For me upgrading ktlint plugin to latest version which is 0.40.0 at the moment, helped.
Most helpful comment
We have exactly the same issue :(