Gabriele Rugani
05/14/2021, 12:40 PMWhat could happen if I would use different libraries with different kotlin version ?
Do you update your project's kotlin language's version only when all the imported libraries are updated ?
Gabriele Rugani
05/14/2021, 2:44 PMRuntime JAR files in the classpath should have the same version. These
files were found in the classpath:
and
w: Consider providing an explicit dependency on kotlin-reflect 1.5 to
prevent strange errorsw: Some runtime JAR files in the classpath have
an incompatible version. Consider removing them from the classpath
ephemient
05/14/2021, 2:47 PMGabriele Rugani
05/14/2021, 3:50 PMephemient
05/14/2021, 3:57 PMephemient
05/14/2021, 4:00 PMdependencies {
implementation(platform(kotlin("bom"))) // Kotlin Gradle DSL
implementation platform("org.jetbrains.kotlin:kotlin-bom:$kotlin_version") // Groovy Gradle DSL (probably, I don't use it)
}
then Gradle will make sure all the standard library artifact versions are aligned, regardless of which ones are included transitivelyephemient
05/14/2021, 4:02 PMephemient
05/14/2021, 4:03 PMGabriele Rugani
05/14/2021, 4:05 PMColton Idle
05/14/2021, 9:11 PMephemient
05/14/2021, 9:13 PMGabriele Rugani
05/17/2021, 8:21 AMephemient
05/17/2021, 8:56 AMGabriele Rugani
05/17/2021, 9:03 AMimplementation(platform("org.jetbrains.kotlin:kotlin-bom"))
but when I execute the clean task the warning appears:
Task :buildSrc:compileKotlin
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
C:/Users/""/.gradle/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/lib/kotlin-stdlib-1.3.72.ja
r (version 1.3)
C:/Users/""/.gradle/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/lib/kotlin-stdlib-common-1.
3.72.jar (version 1.3)
C:/Users/""/.gradle/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/lib/kotlin-stdlib-jdk7-1.3.
72.jar (version 1.3)
C:/Users/""/.gradle/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/lib/kotlin-stdlib-jdk8-1.3.
72.jar (version 1.3)
C:/Users/""/.gradle/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/lib/kotlin-reflect-1.3.72.j
ar (version 1.3)
C:/Users/""/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.0/65fbc439df2e4aad1f376976
2d54534f1b564090/kotlin-stdlib-jdk8-1.5.0.jar (version 1.5)
C:/Users/""/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.5.0/f61904618ea7be07a66e0545
ffe8dc2c70a19b77/kotlin-stdlib-jdk7-1.5.0.jar (version 1.5)
C:/Users/""/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.4.31/63db9d66c3d20f7b8f66196e7ba
86969daae8b8a/kotlin-reflect-1.4.31.jar (version 1.4)
C:/Users/""/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.5.0/29dae2501ca094416d15af0e21470
cb634780444/kotlin-stdlib-1.5.0.jar (version 1.5)
C:/Users/""/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.5.0/4080d69efca5e39e9b4972
f125e40f1607bd6460/kotlin-stdlib-common-1.5.0.jar (version 1.5)
w: Consider providing an explicit dependency on kotlin-reflect 1.5 to prevent strange errors
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
I'm not understanding anything.. 😥ephemient
05/17/2021, 9:05 AMephemient
05/17/2021, 9:07 AMephemient
05/17/2021, 9:07 AMGabriele Rugani
05/17/2021, 9:36 AMimplementation(platform("org.jetbrains.kotlin:kotlin-bom"))
in the app's gradle.
In the buildSrc I have devoloped a task to get the jacoco-plugin coverage, and I'm importing the last gradle version:
apply plugin: 'java-gradle-plugin'
apply plugin: 'kotlin'
buildscript {
ext.gradle_version = '4.2.1'
repositories {
google()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0"
classpath "com.android.tools.build:gradle:$gradle_version"
}
}
repositories {
google()
jcenter()
}
dependencies {
// Android gradle plugin will allow us to access Android specific features
implementation "com.android.tools.build:gradle:$gradle_version"
implementation "com.android.tools.build:gradle-api:$gradle_version"
}
gradlePlugin {
plugins {
create("AndroidCoveragePlugin") {
id = "AndroidCoveragePlugin"
implementationClass = "com.myApp.buildtools.AndroidCoveragePlugin"
}
}
}
Inside agp 4.2.1 there aren't kotlin 1.5.0 ?ephemient
05/17/2021, 9:38 AMephemient
05/17/2021, 9:39 AMGabriele Rugani
05/17/2021, 10:01 AMGradle is tested with Kotlin 1.3.21 through 1.4.0.
.....
Which it means I can't resolve the issue, if I would keep the project to the last kotlin version. In this case I have to live with the warning, and I have to hope that the gradle plugin continue to working well.ephemient
05/17/2021, 10:04 AMephemient
05/17/2021, 10:09 AMephemient
05/17/2021, 10:10 AMGabriele Rugani
05/17/2021, 10:33 AM