https://kotlinlang.org logo
#kvision
Title
# kvision
k

Kaj Koivunen

11/01/2023, 3:12 PM
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

pambrose

11/01/2023, 3:19 PM
JDK 17 and Gradle 8.4 work for me
k

Kaj Koivunen

11/01/2023, 3:22 PM
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

Robert Jaros

11/01/2023, 3:26 PM
I'm not sure why the higher version should not work, but I actually didn't test it on jdk 20.
k

Kaj Koivunen

11/01/2023, 3:27 PM
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

Robert Jaros

11/01/2023, 3:28 PM
Do you see this error when running gradle from the command line or when importing project in intellij?
k

Kaj Koivunen

11/01/2023, 3:28 PM
trying to build in intellij
r

Robert Jaros

11/01/2023, 3:29 PM
And you have selected JDK 17 in the
File -> Project structure ...
settings ?
k

Kaj Koivunen

11/01/2023, 3:31 PM
yes, it's set to jdk 17
r

Robert Jaros

11/01/2023, 3:34 PM
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

Kaj Koivunen

11/01/2023, 3:38 PM
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

Robert Jaros

11/01/2023, 3:38 PM
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

Kaj Koivunen

11/01/2023, 3:38 PM
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

Robert Jaros

11/01/2023, 3:41 PM
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

Kaj Koivunen

11/01/2023, 3:42 PM
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

Robert Jaros

11/01/2023, 3:42 PM
Things are deprecated with every new gradle release :-)
I usually try to keep the project wizard templates up to date.
k

Kaj Koivunen

11/01/2023, 3:43 PM
having to go through migrating from kotlin js -> kotlin multiplatform as a first thing is a drag though
r

Robert Jaros

11/01/2023, 3:45 PM
What version of the project wizard do you have?
k

Kaj Koivunen

11/01/2023, 3:45 PM
well the wizard hasn't been updated since kvision 6.2.0 so no surprise it's all kinds of wonky
r

Robert Jaros

11/01/2023, 3:45 PM
It has been updated
k

Kaj Koivunen

11/01/2023, 3:45 PM
Version 0.6.1
it doesn't show any updates
r

Robert Jaros

11/01/2023, 3:45 PM
All the projects are multiplatform
There is something wrong with your marketplace
It should be 0.8.0
k

Kaj Koivunen

11/01/2023, 3:47 PM
it doesn't appear to support updating from the plugins menu then
r

Robert Jaros

11/01/2023, 3:47 PM
What version of IntelliJ do you have?
The current plugin should work with 2023.2+
k

Kaj Koivunen

11/01/2023, 3:49 PM
2022.3.1
r

Robert Jaros

11/01/2023, 3:49 PM
And that's the source of your problems I suppose
p

pambrose

11/01/2023, 3:50 PM
Do yourself a favor and use this: https://www.jetbrains.com/toolbox-app/
k

Kaj Koivunen

11/01/2023, 4:18 PM
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
12 Views