diff --git a/uhabits-android/build.gradle.kts b/uhabits-android/build.gradle.kts index 7dfbee50b..26d785db5 100644 --- a/uhabits-android/build.gradle.kts +++ b/uhabits-android/build.gradle.kts @@ -29,6 +29,17 @@ tasks.compileLint { dependsOn("updateTranslators") } +/* +Added on top of kotlinOptions to work around this issue: +https://youtrack.jetbrains.com/issue/KTIJ-24311/task-current-target-is-17-and-kaptGenerateStubsProductionDebugKotlin-task-current-target-is-1.8-jvm-target-compatibility-should#focus=Comments-27-6798448.0-0 +Updating gradle might fix this, so try again in the future to remove this and run: +./gradlew --rerun-tasks :uhabits-android:kaptGenerateStubsReleaseKotlin +If this doesn't produce any warning, try to remove it. + */ +kotlin { + jvmToolchain(11) +} + android { compileSdk = 32 @@ -69,8 +80,11 @@ android { compileOptions { isCoreLibraryDesugaringEnabled = true - targetCompatibility(JavaVersion.VERSION_1_8) - sourceCompatibility(JavaVersion.VERSION_1_8) + targetCompatibility(JavaVersion.VERSION_11) + sourceCompatibility(JavaVersion.VERSION_11) + } + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures { diff --git a/uhabits-core/build.gradle.kts b/uhabits-core/build.gradle.kts index 1eb749305..caa41617c 100644 --- a/uhabits-core/build.gradle.kts +++ b/uhabits-core/build.gradle.kts @@ -24,6 +24,7 @@ plugins { kotlin { jvm().withJava() + jvmToolchain(11) sourceSets { val commonMain by getting { @@ -61,7 +62,7 @@ kotlin { implementation("org.xerial:sqlite-jdbc:3.42.0.0") implementation("org.hamcrest:hamcrest:2.2") implementation("org.apache.commons:commons-io:1.3.2") - implementation("org.mockito.kotlin:mockito-kotlin:4.1.0") + implementation("org.mockito.kotlin:mockito-kotlin:5.0.0") implementation("org.junit.jupiter:junit-jupiter:5.10.0") } }