Open nicolas-raoul opened 8 months ago
Now it works with the same JDK version 17, not sure what was happening.
Now failing with this error again. I don't think I changed my Java configuration on my machine, though there might have been a silent update.
I tried these changes:
diff --git a/app/build.gradle b/app/build.gradle
index c309a52b2..a7dcfafaa 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -164,10 +164,10 @@ dependencies {
//OSMDroid
implementation ("org.osmdroid:osmdroid-android:$OSMDROID_VERSION")
constraints {
- implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
+ implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.20") {
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
}
- implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
+ implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.20") {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
}
@@ -352,8 +352,8 @@ android {
compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
}
buildToolsVersion buildToolsVersion
diff --git a/data-client/build.gradle b/data-client/build.gradle
index 3b2a33cd1..43fcd37b2 100644
--- a/data-client/build.gradle
+++ b/data-client/build.gradle
@@ -14,7 +14,7 @@
// email - me@dmitrybrant.com
buildscript {
- ext.kotlin_version = '1.7.20'
+ ext.kotlin_version = '1.9.20'
repositories {
mavenCentral()
google()
@@ -59,8 +59,8 @@ android {
abortOnError false
}
compileOptions {
- sourceCompatibility = '1.8'
- targetCompatibility = '1.8'
+ sourceCompatibility = '17'
+ targetCompatibility = '17'
}
namespace 'org.wikipedia.dataclient'
}
@@ -89,10 +89,10 @@ dependencies {
testImplementation "commons-io:commons-io:2.6"
constraints {
- implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
+ implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.20") {
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
}
- implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
+ implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.20") {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
}
diff --git a/gradle.properties b/gradle.properties
index f0646307c..3fe5eff6c 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -17,7 +17,7 @@ org.gradle.jvmargs=-Xmx1536M
org.gradle.caching=true
android.enableR8.fullMode=false
-KOTLIN_VERSION=1.7.20
+KOTLIN_VERSION=1.9.20
BUTTERKNIFE_VERSION=10.1.0
LEAK_CANARY_VERSION=2.10
DAGGER_VERSION=2.23
but get this error:
Task :wikimedia-data-client:compileDebugKotlin FAILED e: The Android extensions ('kotlin-android-extensions') compiler plugin is no longer supported. Please use kotlin parcelize and view binding. More information: https://goo.gle/kotlin-android-extensions-deprecation
I am getting the same error with a very old code version from 3 months ago (2ddb6b2e5ea0643aa46f0ad20bd7b6862b4e1e79) despite the fact that I have build it (and many other since) successfully in the past.
So this seems to be related to a change on my machine rather than a change in the app's code.
What is this error about? Does it occur when upgrading the JDK version to 21.
@nicolas-raoul is it fixed for you as I am facing the same error?
@Pujan92 I am not facing this error anymore, but honestly I am not sure why. If you find, please let us know here. :-)
@nicolas-raoul Thanks, I downgraded the kotlin version from 1.8.10
to 1.6.20
and it gets fixed for now.
Its seems fixed and working for me with below kotlin and gradle configuration.
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip
classpath 'com.android.tools.build:gradle:7.0.0'
Kotlin version : 1.6.20
With JDK version 17
But it's not working with the newer version. Did you find any reason why?
I was on kotlin version 1.9.0 and had the same issue. I upgraded to kotlin version 1.9.22 and it seems to have fixed it.
I was on org.jetbrains.kotlin.android version 1.9.20 and had that error. Only @DSDrachmann solution worked for me.
I was on org.jetbrains.kotlin.android version 1.9.20 and had that error. Only @DSDrachmann solution worked for me.
That's good to hear! a small fix but glad that you also got past that problem
Since updating to Java 21.0.1 (OpenJDK Runtime Environment Zulu21.30+15-CA) I get this error when running
./gradlew clean installProdDebug
:I tried updating kotlin-gradle-plugin to 1.9.20 but the I get a deprecation error.
Strangely I still get it when running
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/ ANDROID_SDK_ROOT=/Users/nicolasraoul/Library/Android/sdk ./gradlew clean installProdDebug