Could someone point out a combination of JDK & Gra...
# kvision
k
Could someone point out a combination of JDK & Gradle versions that are able to succesfully build the barebones Kvision project generated by the IntelliJ Kvision project wizard? I'm currently trying with JDK 20 & Gradle 8.4 but it fails with
Could not resolve io.kvision:kvision-gradle-plugin:6.6.0.
.
Bumping Kvision version 7.0.1 fails with the same error, apart from the different version number ofc
p
JDK 17 and Gradle 8.4 work for me
k
I'll try 17 next
the docs for setting up kvision at https://kvision.gitbook.io/kvision-guide/1.-getting-started-1/setting-up should probably not say "17 or higher" if no higher version actually works...
r
I'm not sure why the higher version should not work, but I actually didn't test it on jdk 20.
k
Nope, doesn't work: JDK 17 Gradle 8.4 Kvision 7.0.1 Throws
Copy code
> Could not resolve io.kvision:kvision-gradle-plugin:7.0.1.
     Required by:
         project : > io.kvision:io.kvision.gradle.plugin:7.0.1
      > No matching variant of io.kvision:kvision-gradle-plugin:7.0.1 was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.4' but:
          - Variant 'apiElements' capability io.kvision:kvision-gradle-plugin:7.0.1 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component for use during compile-time, compatible with Java 17 and the consumer needed a component for use during runtime, compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.4')
          - Variant 'javadocElements' capability io.kvision:kvision-gradle-plugin:7.0.1 declares a component for use during runtime, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.4')
          - Variant 'runtimeElements' capability io.kvision:kvision-gradle-plugin:7.0.1 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.4')
          - Variant 'sourcesElements' capability io.kvision:kvision-gradle-plugin:7.0.1 declares a component for use during runtime, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.4')
r
Do you see this error when running gradle from the command line or when importing project in intellij?
k
trying to build in intellij
r
And you have selected JDK 17 in the
File -> Project structure ...
settings ?
k
yes, it's set to jdk 17
r
The same issue was reported
But there is no feedback if any of the solutions worked
I have some different JDKs configured in my intellij (including 1.8 for some older projects).
In general when I import new KVision project it selects 1.8 by default and I see errors.
k
I tried setting gradle to jdk17 too and at least now it's downloading modules from maven, still have to see if it actually builds but this is progress
r
I need to switch JDK to the 17 in the project structure menu and reload gradle project from the gradle menu.
It works fine every time.
k
I'd want to love kotlin so bad but I've never had the displeasure of using a build system more brittle than gradle and having to finagle the jdk versions every single time is a huge hurdle to getting started
yeah it's building now, thanks for the tips
r
I would say there is nothing wrong with gradle when running tasks from the command line. They work always the same and the error messages are in general readable and clear. But importing gradle project in lntelliJ is a totally different thing ...
k
it does appear that the project generated by the wizard uses a lot of deprecated stuff so it's still a lot of fixing to get it up to standard, I'd just wish you could get a project started without this much manual work
r
Things are deprecated with every new gradle release :-)
I usually try to keep the project wizard templates up to date.
k
having to go through migrating from kotlin js -> kotlin multiplatform as a first thing is a drag though
r
What version of the project wizard do you have?
k
well the wizard hasn't been updated since kvision 6.2.0 so no surprise it's all kinds of wonky
r
It has been updated
k
Version 0.6.1
it doesn't show any updates
r
All the projects are multiplatform
There is something wrong with your marketplace
It should be 0.8.0
k
it doesn't appear to support updating from the plugins menu then
r
What version of IntelliJ do you have?
The current plugin should work with 2023.2+
k
2022.3.1
r
And that's the source of your problems I suppose
p
Do yourself a favor and use this: https://www.jetbrains.com/toolbox-app/
k
After updating intellij I managed to build and run the project once, but now when I try to make any edit to it it still builds but it won't no longer run with this wonderfully clear error:
Copy code
> Task :compileKotlinJs FAILED
e: Could not find "kotlin" in [C:\Users\theka\AppData\Local\kotlin\daemon]
e: java.lang.IllegalStateException: FATAL ERROR: Could not find "kotlin" in [C:\Users\theka\AppData\Local\kotlin\daemon]
Copy code
Execution failed for task ':compileKotlinJs'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Internal compiler error. See log for more details
Kotlin is my most favorite language in terms of syntax and language features and least favorite language in terms of tooling and build systems