# getting-started

David Smith

05/18/2022, 10:13 AM
I’ve written a custom ktlint rule but when I try to run it with gradle using the ktlint plugin I get the following
Copy code
Too many element types registered. Out of (short) range. Most of element types (14991) were registered for 'Language: kotlin'
I’m completely stuck on this, it works fine if I run the ktlint binary with the jar file directly, seems like its something to do with the gradle plugin?
ok so this was some weird plugin caching problem. I could see that when I made changes to my custom plugin they weren’t being used by the ktlintCheck task, I then ran it with the
flag and it somehow cleaned things up

Chris Fillmore

05/19/2022, 11:09 PM
#ktlint might help

David Smith

05/20/2022, 9:05 PM
oh nice, hadn’t found that channel, thanks