rjaros / kvision

Object oriented web framework for Kotlin/JS
https://kvision.io
MIT License
1.23k stars 65 forks source link

Kvision Gradle Plugin issue #487

Closed SekhReddy closed 11 months ago

SekhReddy commented 1 year ago

Hello, I generated a KVision project using the wizard built into IntelliJ. I can't seem to get the project to build. Below is the exception output. I tried adding the kvision-gradle-plugin to the build.gradle.kts file to no avail. I also tried editing the java version in the gradle.properties to Java 8, with no change in output.

Please let me know what can be done about this. Thank you kindly.

`A problem occurred configuring root project 'marketplace'.

Could not resolve all files for configuration ':classpath'. Could not resolve io.kvision:kvision-gradle-plugin:6.6.0. Required by: project : > io.kvision:io.kvision.gradle.plugin:6.6.0 No matching variant of io.kvision:kvision-gradle-plugin:6.6.0 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.2' but:

  • Variant 'apiElements' capability io.kvision:kvision-gradle-plugin:6.6.0 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.2')
  • Variant 'javadocElements' capability io.kvision:kvision-gradle-plugin:6.6.0 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.2')
  • Variant 'runtimeElements' capability io.kvision:kvision-gradle-plugin:6.6.0 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.2')
  • Variant 'sourcesElements' capability io.kvision:kvision-gradle-plugin:6.6.0 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.2')
rjaros commented 1 year ago

Since KVision 6.0 only JDK 17 and later is supported. So you can't use JDK 8 or 11 with KVision project. If you have such version configured in your IDE it's probably picked up by default. Just go to "Project structure" menu, select JDK 17 and reload the project.

mille5a9 commented 1 year ago

I was just having this exact issue and my project structure has openjdk 19.0.2

I was able to solve the issue following the answer on this stackoverflow post (although in this case we want more than 11):

Ended up changing Gradle JDK to 11. File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle

rjaros commented 1 year ago

I don't even have this option in my Intellij Idea Ultimate (Linux version). But sometimes importing a project from scratch (by removing .idea directory first) makes wonders :-)