I am trying to add dependency org.jetbrains.kotlinx:kotlinx.html.js:0.5.9 using Gradle,
But I’m getting error kotlinx.html.js-0.5.9.jar' was compiled with an incompatible version of Kotlin. Its ABI version is 3, expected version is 5
def kotlin_version = '1.0.6'
buildscript {
ext.kotlin_version = '1.0.6'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin2js'
sourceSets {
main.kotlin.srcDirs += 'src/kotlin'
}
task jarSources(type: Jar) {
from sourceSets.main.allSource
classifier = 'source'
}
def outDir = "js"
artifacts {
compile jarSources
}
compileKotlin2Js {
kotlinOptions.metaInfo = true
kotlinOptions.outputFile = "$outDir/result.js"
}
jar {
from sourceSets.main.allSource
include "**/*.kt"
from outDir
include "**/*.js"
destinationDir = file("$outDir")
manifest {
attributes(
"Specification-Title": "Kotlin JavaScript Lib",
"Kotlin-JS-Module-Name": "test-library"
)
}
}
jar.dependsOn(compileKotlin2Js)
repositories {
mavenCentral()
maven {
url "https://jcenter.bintray.com"
}
}
dependencies {
def kotlinx_html_version = "0.5.9"
compile "org.jetbrains.kotlinx:kotlinx.html.js:$kotlinx_html_version"
compile "org.jetbrains.kotlin:kotlin-js-library:$kotlin_version"
}
task wrapper(type: Wrapper) {
gradleVersion = "2.7"
}
defaultTasks "build"
Here is my gradle script. Kinda messy, but It’s not so easy to me understand, what am I doing wrong. I tried with
Intellij Idea Kotlin, versions : 1.0.6[stable], 1.0.x[Early access previoew]m 1.1.x[Early access preview]. Same everywhere
Here is message from IDEA when trying to add dependency from .jar file kotlnx html js version 0.5.0