Skip to content
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

1.5.0 fails to build from source with kotlin 2.1.0 #2910

Closed
svenstaro opened this issue Dec 22, 2024 · 2 comments
Closed

1.5.0 fails to build from source with kotlin 2.1.0 #2910

svenstaro opened this issue Dec 22, 2024 · 2 comments

Comments

@svenstaro
Copy link

Expected Behavior

It should build without errors.

Observed Behavior

It fails to build with errors.

Steps to Reproduce

gradle --no-configuration-cache --no-scan --no-daemon --console plain -Pktlint.publication.signing.enable=false shadowJarExecutable

Your Environment

  • Version of ktlint used: 1.5.0
  • Relevant parts of the .editorconfig settings
  • Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task):
  • Version of Gradle used (if applicable): 8.10.2
  • Operating System and version: Arch Linux
Welcome to Gradle 8.10.2!

Here are the highlights of this release:
 - Support for Java 23
 - Faster configuration cache
 - Better configuration cache reports

For more details see https://docs.gradle.org/8.10.2/release-notes.html

To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.10.2/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
Daemon will be stopped at the end of the build 
Type-safe project accessors is an incubating feature.
> Task :build-logic:checkKotlinGradlePluginConfigurationErrors
> Task :build-logic:generateExternalPluginSpecBuilders
> Task :build-logic:extractPrecompiledScriptPluginPlugins
> Task :build-logic:compilePluginsBlocks
> Task :build-logic:generatePrecompiledScriptPluginAccessors
> Task :build-logic:generateScriptPluginAdapters
> Task :build-logic:pluginDescriptors
> Task :build-logic:processResources

> Task :build-logic:compileKotlin FAILED
e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
e: file:///build/.gradle/caches/modules-2/files-2.1/dev.drewhamilton.poko/poko-gradle-plugin/0.18.0/160eb771d3fbd5b08d4380bac479350678ac5ca4/poko-gradle-plugin-0.18.0.jar!/META-INF/poko-gradle-plugin.kotlin_moduleModule was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.9.0.
e: file:///build/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/2.1.0/85f8b81009cda5890e54ba67d64b5e599c645020/kotlin-stdlib-2.1.0.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_moduleModule was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.9.0.
e: file:///build/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/2.1.0/85f8b81009cda5890e54ba67d64b5e599c645020/kotlin-stdlib-2.1.0.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_moduleModule was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.9.0.
e: file:///build/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/2.1.0/85f8b81009cda5890e54ba67d64b5e599c645020/kotlin-stdlib-2.1.0.jar!/META-INF/kotlin-stdlib.kotlin_moduleModule was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.9.0.
e: file:///build/ktlint/src/ktlint/build-logic/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_26bad9cf06b16a24497522a47114d5cf/Accessors67sgsq0j0kh5lw9fwm4xumjhc.kt:65:65 Class 'dev.drewhamilton.poko.gradle.PokoPluginExtension' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /build/.gradle/caches/modules-2/files-2.1/dev.drewhamilton.poko/poko-gradle-plugin/0.18.0/160eb771d3fbd5b08d4380bac479350678ac5ca4/poko-gradle-plugin-0.18.0.jar!/dev/drewhamilton/poko/gradle/PokoPluginExtension.class
e: file:///build/ktlint/src/ktlint/build-logic/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_26bad9cf06b16a24497522a47114d5cf/Accessors67sgsq0j0kh5lw9fwm4xumjhc.kt:66:114 Class 'dev.drewhamilton.poko.gradle.PokoPluginExtension' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /build/.gradle/caches/modules-2/files-2.1/dev.drewhamilton.poko/poko-gradle-plugin/0.18.0/160eb771d3fbd5b08d4380bac479350678ac5ca4/poko-gradle-plugin-0.18.0.jar!/dev/drewhamilton/poko/gradle/PokoPluginExtension.class
e: file:///build/ktlint/src/ktlint/build-logic/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_26bad9cf06b16a24497522a47114d5cf/Accessors67sgsq0j0kh5lw9fwm4xumjhc.kt:72:82 Class 'dev.drewhamilton.poko.gradle.PokoPluginExtension' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /build/.gradle/caches/modules-2/files-2.1/dev.drewhamilton.poko/poko-gradle-plugin/0.18.0/160eb771d3fbd5b08d4380bac479350678ac5ca4/poko-gradle-plugin-0.18.0.jar!/dev/drewhamilton/poko/gradle/PokoPluginExtension.class
e: file:///build/ktlint/src/ktlint/build-logic/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_26bad9cf06b16a24497522a47114d5cf/Accessors7xcd19jbvd6f8bjiwzclr5oyx.kt:65:34 Class 'dev.drewhamilton.poko.gradle.PokoPluginExtension' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /build/.gradle/caches/modules-2/files-2.1/dev.drewhamilton.poko/poko-gradle-plugin/0.18.0/160eb771d3fbd5b08d4380bac479350678ac5ca4/poko-gradle-plugin-0.18.0.jar!/dev/drewhamilton/poko/gradle/PokoPluginExtension.class
e: file:///build/ktlint/src/ktlint/build-logic/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_26bad9cf06b16a24497522a47114d5cf/Accessors7xcd19jbvd6f8bjiwzclr5oyx.kt:66:6 Class 'dev.drewhamilton.poko.gradle.PokoPluginExtension' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /build/.gradle/caches/modules-2/files-2.1/dev.drewhamilton.poko/poko-gradle-plugin/0.18.0/160eb771d3fbd5b08d4380bac479350678ac5ca4/poko-gradle-plugin-0.18.0.jar!/dev/drewhamilton/poko/gradle/PokoPluginExtension.class
e: file:///build/ktlint/src/ktlint/build-logic/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_26bad9cf06b16a24497522a47114d5cf/Accessors7xcd19jbvd6f8bjiwzclr5oyx.kt:72:34 Class 'dev.drewhamilton.poko.gradle.PokoPluginExtension' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /build/.gradle/caches/modules-2/files-2.1/dev.drewhamilton.poko/poko-gradle-plugin/0.18.0/160eb771d3fbd5b08d4380bac479350678ac5ca4/poko-gradle-plugin-0.18.0.jar!/dev/drewhamilton/poko/gradle/PokoPluginExtension.class
e: file:///build/ktlint/src/ktlint/build-logic/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_26bad9cf06b16a24497522a47114d5cf/Accessors7xcd19jbvd6f8bjiwzclr5oyx.kt:73:6 Class 'dev.drewhamilton.poko.gradle.PokoPluginExtension' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /build/.gradle/caches/modules-2/files-2.1/dev.drewhamilton.poko/poko-gradle-plugin/0.18.0/160eb771d3fbd5b08d4380bac479350678ac5ca4/poko-gradle-plugin-0.18.0.jar!/dev/drewhamilton/poko/gradle/PokoPluginExtension.class
e: file:///build/ktlint/src/ktlint/build-logic/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_69e255c73e419e46f757b3c42831abc7/Accessors67sgsq0j0kh5lw9fwm4xumjhc.kt:65:65 Class 'dev.drewhamilton.poko.gradle.PokoPluginExtension' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /build/.gradle/caches/modules-2/files-2.1/dev.drewhamilton.poko/poko-gradle-plugin/0.18.0/160eb771d3fbd5b08d4380bac479350678ac5ca4/poko-gradle-plugin-0.18.0.jar!/dev/drewhamilton/poko/gradle/PokoPluginExtension.class
e: file:///build/ktlint/src/ktlint/build-logic/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_69e255c73e419e46f757b3c42831abc7/Accessors67sgsq0j0kh5lw9fwm4xumjhc.kt:66:114 Class 'dev.drewhamilton.poko.gradle.PokoPluginExtension' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /build/.gradle/caches/modules-2/files-2.1/dev.drewhamilton.poko/poko-gradle-plugin/0.18.0/160eb771d3fbd5b08d4380bac479350678ac5ca4/poko-gradle-plugin-0.18.0.jar!/dev/drewhamilton/poko/gradle/PokoPluginExtension.class
e: file:///build/ktlint/src/ktlint/build-logic/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_69e255c73e419e46f757b3c42831abc7/Accessors67sgsq0j0kh5lw9fwm4xumjhc.kt:72:82 Class 'dev.drewhamilton.poko.gradle.PokoPluginExtension' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /build/.gradle/caches/modules-2/files-2.1/dev.drewhamilton.poko/poko-gradle-plugin/0.18.0/160eb771d3fbd5b08d4380bac479350678ac5ca4/poko-gradle-plugin-0.18.0.jar!/dev/drewhamilton/poko/gradle/PokoPluginExtension.class
e: file:///build/ktlint/src/ktlint/build-logic/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_69e255c73e419e46f757b3c42831abc7/Accessors7xcd19jbvd6f8bjiwzclr5oyx.kt:65:34 Class 'dev.drewhamilton.poko.gradle.PokoPluginExtension' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /build/.gradle/caches/modules-2/files-2.1/dev.drewhamilton.poko/poko-gradle-plugin/0.18
.0/160eb771d3fbd5b08d4380bac479350678ac5ca4/poko-gradle-plugin-0.18.0.jar!/dev/drewhamilton/poko/gradle/PokoPluginExtension.class
e: file:///build/ktlint/src/ktlint/build-logic/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_69e255c73e419e46f757b3c42831abc7/Accessors7xcd19jbvd6f8bjiwzclr5oyx.kt:66:6 Class 'dev.drewhamilton.poko.gradle.PokoPluginExtension' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /build/.gradle/caches/modules-2/files-2.1/dev.drewhamilton.poko/poko-gradle-plugin/0.18.0/160eb771d3fbd5b08d4380bac479350678ac5ca4/poko-gradle-plugin-0.18.0.jar!/dev/drewhamilton/poko/gradle/PokoPluginExtension.class
e: file:///build/ktlint/src/ktlint/build-logic/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_69e255c73e419e46f757b3c42831abc7/Accessors7xcd19jbvd6f8bjiwzclr5oyx.kt:72:34 Class 'dev.drewhamilton.poko.gradle.PokoPluginExtension' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /build/.gradle/caches/modules-2/files-2.1/dev.drewhamilton.poko/poko-gradle-plugin/0.18.0/160eb771d3fbd5b08d4380bac479350678ac5ca4/poko-gradle-plugin-0.18.0.jar!/dev/drewhamilton/poko/gradle/PokoPluginExtension.class
e: file:///build/ktlint/src/ktlint/build-logic/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_69e255c73e419e46f757b3c42831abc7/Accessors7xcd19jbvd6f8bjiwzclr5oyx.kt:73:6 Class 'dev.drewhamilton.poko.gradle.PokoPluginExtension' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /build/.gradle/caches/modules-2/files-2.1/dev.drewhamilton.poko/poko-gradle-plugin/0.18.0/160eb771d3fbd5b08d4380bac479350678ac5ca4/poko-gradle-plugin-0.18.0.jar!/dev/drewhamilton/poko/gradle/PokoPluginExtension.class

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':build-logic:compileKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Get more help at https://help.gradle.org.

BUILD FAILED in 1m 9s
9 actionable tasks: 9 executed
@paul-dingemans
Copy link
Collaborator

I cannot reproduce your problem, but I am building from MacOS with Gradle 8.12.

I do note in your log output that the Poko version 0.18.0 is used. In ktlint 1.5.0 however this dependency was updated to 0.18.1. I am not sure whether it is related.

Can you check that you build from latest sources? Have you made any modification? Also, it might help if you build without option no_scan and provide the link to build scan here.

@svenstaro
Copy link
Author

It was indeed a problem of an outdated version of Gradle! Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants