GarouDan
06/10/2020, 12:03 AMIncompatible Kotlin/Native libraries
There are 549 libraries libraries from the Kotlin/Native 1.3.72 distribution attached to the project: stdlib, ARKit, ARKit, ARKit, AVFoundation, ...
These libraries were compiled with an older Kotlin/Native compiler and can't be read in IDE.
Please edit Gradle buildfile(s) to use Kotlin Gradle plugin version 1.4-M2. Then re-import the project in IDE.
My project is already using 1.4-M2
, as suggested, but I suppose the problem comes from Gradle, since 6.5
(latest) version points to 1.3.72
.
Does someone know what we can do about it?
How can we configure the project to avoid this error?
I’m not sure, but I’m facing a issue where the run/debug buttons are not working as well. I’m using the latest IntelliJ EAPgildor
06/10/2020, 5:59 AMAlexey Belkov [JB]
06/10/2020, 10:36 AM./gradlew dependencies
) and the 1.4-M2 IDE plugin is installed. It should work. If it doesn't - please report an issue at http://kotl.in/issue with a sample project to reproduce, so we can investigate it.GarouDan
06/10/2020, 12:04 PM1.3.72
and it is working fine, but I’ll take a look and return. But I do have a buldSrc
module that compiles kotlin things, specially, I cannot control which kotlin version will be used there in a good way, since, I think, the plugin kotlin_dsl
uses a different version of Kotlin.louiscad
06/10/2020, 12:08 PMbuildSrc
depend on the kotlin gradle plugin itself?GarouDan
06/10/2020, 12:11 PMorg.jetbrains.kotlin:kotlin-gradle-plugin
as one if its dependencies (but I was getting the 1.4-M2
there, as I checked). I’ll attach the full file here.louiscad
06/10/2020, 12:12 PMGarouDan
06/10/2020, 12:12 PMimport org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
`kotlin-dsl`
}
// TODO Due to Gradle limitation we needed to bundle all code of the plugins together.
apply("../plugin/bundle.gradle.kts")
@Suppress("unchecked_cast", "nothing_to_inline")
inline fun <T> uncheckedCast(target: Any?): T = target as T
val getProperty = uncheckedCast<(key: String) -> String>(extra["getProperty"])
val getDependency = uncheckedCast<(group: String, dependencyId: String) -> String>(extra["getDependency"])
val getDependencyVersion = uncheckedCast<(group: String, dependencyId: String) -> String>(extra["getDependencyVersion"])
repositories {
flatDir { dirs("$rootDir/plugin") }
mavenLocal()
gradlePluginPortal()
mavenCentral()
jcenter()
google()
maven( url = "<https://plugins.gradle.org/m2>" )
maven( url = "<https://repo.gradle.org/gradle/libs-releases-local>" )
maven( url = "<https://dl.bintray.com/kotlin/kotlin-eap>" )
// maven( url = "<https://dl.bintray.com/kotlin/kotlin-dev>" )
}
dependencies {
// For extending Gradle classes
implementation(gradleApi())
// For exteding the Gradle Kotlin plugin classes. The current kotlin version should be grabbed.
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin")
// For Jackson support
implementation(getDependency("buildSrc/build.gradle.kts", "com.fasterxml.jackson.core:jackson-databind"))
implementation(getDependency("buildSrc/build.gradle.kts", "com.fasterxml.jackson.module:jackson-module-kotlin"))
// implementation(getDependency("buildSrc/build.gradle.kts", "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml"))
// For buildSrc tests
testImplementation(getDependency("buildSrc/build.gradle.kts", "junit:junit"))
}
/**
* Using `-Xskip-metadata-version-check` we avoid problems when using the most recent kotlin versions.
*/
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xskip-metadata-version-check")
}
}
GarouDan
06/10/2020, 12:13 PMgit clean -dfx
, which would be better for clean, but I was still facing the problem.louiscad
06/10/2020, 12:14 PM./gradlew clean
, not git related stuffGarouDan
06/10/2020, 12:15 PMlouiscad
06/10/2020, 12:26 PMclean
task.GarouDan
06/10/2020, 12:27 PMlouiscad
06/10/2020, 12:27 PMGarouDan
06/10/2020, 12:27 PMGarouDan
06/10/2020, 3:44 PM1.4-M2
, but with IntelliJ and it is a bit annoying.
When in IntelliJ, it seems the Gradle environment only works with my 11.0.6-zulu
jdk.
I changed the settings to very different options and it only worked with this version.
For example 11.0.7.fx-zulu
and 14.0.1-zulu
don’t work there.
The project can be configured to use Kotlin 1.4-M2
and Gradle 6.5
(I’m investing more),
but if you change the settings in:
Preferences -> Build, Execution, Deployment -> Gradle
to:
Use Gradle from -> “wrapper task”
Gradle JVM -> “11.0.6-zulu” (in my case changing here to other JDK versions do not work)
seems to work.