question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.IllegalArgumentException: Count 'n' must be non-negative, but was -1.

See original GitHub issue

Hello!

When I run ./gradlew ktlintFormat I have the error

Execution failed for task ':runKtlintFormatOverKotlinScripts'.
> A failure occurred while executing org.jlleitschuh.gradle.ktlint.worker.KtLintWorkAction
   > java.lang.IllegalArgumentException: Count 'n' must be non-negative, but was -1.

My config

plugins {
    id("org.jlleitschuh.gradle.ktlint") version "10.3.0"
}
ktlint {
    version.set(0.45.2)
    android.set(true)
    filter {
        exclude("**/build/**")
        exclude("**/resources/**")
        exclude("**/generated/**")
    }
    reporters {
        reporter(ReporterType.CHECKSTYLE)
    }
}

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
flefichercommented, Oct 4, 2022

The issue can be reproduced by writing something like this:

MyInterface<XXX.YYY>
    by MyImplementation() 

But writing it like this work:

MyInterface<XXX.YYY> by 
MyImplementation() 
0reactions
jmfayardcommented, Dec 12, 2022

Hello @JLLeitschuh I’m blocked again by this issue I’ve checked again and can say this time that the issue has been fixed upstream. Can you release an update with ktlint 0.47.1 ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception in thread "main" java.lang.IllegalArgumentException
According to the error message, the parameter must be positive. This could be because during expandMaze, you are assigning counts[1] to be ...
Read more >
Negative spacing during indent formatting #1188 - GitHub
Caused by: java.lang.IllegalArgumentException: Count 'n' must be non-negative, but was -4. at kotlin.text.
Read more >
How to solve an IllegalArgumentException in Java?
Reasons for java.lang.IllegalArgumentException. When Arguments out of range. For example, the percentage should lie between 1 to 100.
Read more >
Main.java Source code - Java2s.com
OpenVPN-Settings is distributed in the hope that it will be useful, * but ... < 0) { throw new IllegalArgumentException("Skip count must be...
Read more >
Spigot - SimpleScore | Animated Scoreboard | Page 10
java.lang.IllegalArgumentException: Count 'n' must be non-negative, but was -157. at com.r4g3baby.simplescore.shaded.kotlin.text.StringsKt__ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found