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.

"Use this template" button fails due to Ktlint

See original GitHub issue

I followed the readme and hit “use this template” and it failed on GH actions due to

> Task :runKtlintFormatOverMainSourceSet FAILED
Execution optimizations have been disabled for task ':runKtlintFormatOverMainSourceSet' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: '/home/runner/work/myplugin/myplugin/build/intermediates/ktLint/reporters.bin'. Reason: Task ':runKtlintFormatOverMainSourceSet' uses this output of task ':runKtlintFormatOverKotlinScripts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: '/home/runner/work/myplugin/myplugin/src/main/java'. Reason: Task ':runKtlintFormatOverMainSourceSet' uses this output of task ':runKtlintFormatOverKotlinScripts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: '/home/runner/work/myplugin/myplugin/src/main/kotlin'. Reason: Task ':runKtlintFormatOverMainSourceSet' uses this output of task ':runKtlintFormatOverKotlinScripts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':runKtlintFormatOverMainSourceSet'.
> A failure occurred while executing org.jlleitschuh.gradle.ktlint.worker.KtLintWorkAction
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
YannCebroncommented, Aug 31, 2021

@ColtonIdle Thanks, much appreciated. We’ll hopefully release a new version of this template targeting newer IDE platforms, which will not necessitate this manual workaround (and contain a number of other useful improvements).

1reaction
ColtonIdlecommented, Aug 27, 2021

Still fails. This time… not due to ktlint?

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/jetbrains/pluginverifier/PluginVerifierMain has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

	at java.lang.ClassLoader.defineClass1(Native Method)
> Task :runPluginVerifier FAILED
	at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
13 actionable tasks: 13 executed
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:601)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':runPluginVerifier'.
> Process 'command '/opt/hostedtoolcache/Java_Zulu_jdk/8.0.302-8/x64/bin/java'' finished with non-zero exit value 1
Read more comments on GitHub >

github_iconTop Results From Across the Web

Intellij disagree with ktlint for code with for #1350 - GitHub
Just a small bug: The following code is formatted in intellij idea. But ktlint says it has several formatting errors. p.s. the code...
Read more >
Ktlint
No configuration required ktlint aims to capture the official Kotlin coding conventions and Android Kotlin Style Guide. · Rule sets ·. · Disable...
Read more >
jeremymailen / ktlint Download - JitPack
Such behaviour violates .editorconfig specification and leads to ignoring ... Prepend ! to negate the pattern, KtLint uses .gitignore pattern style syntax.
Read more >
Format Your Kotlin Code With Ktlint - Better Programming
You can take a look at my Kotlin project template to see how I setup Ktlint and Gitlab CI/CD for my Kotlin projects....
Read more >
android - Problems running ktlint from module - Stack Overflow
2 Answers 2 · i tried, and get another error with this changes: ERROR: Failed to resolve: com.github. · use this library for...
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