From 457c9834552d4a4d33f0e2a3833c367a71a8b016 Mon Sep 17 00:00:00 2001 From: Marcos Rodriguez Velez Date: Thu, 18 Jul 2024 22:32:11 -0400 Subject: [PATCH] Update build.gradle --- android/build.gradle | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 3e9d9e6b7..6cb0866a0 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -81,16 +81,13 @@ subprojects { // Apply the JVM target configuration only to 'rn-ldk' and 'react-native-true-sheet' if (project.name == 'rn-ldk' || project.name == 'react-native-true-sheet') { - tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { - kotlinOptions { - jvmTarget = "11" - } - kotlin { - jvmToolchain { - (this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(11)) - } - } + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) { + if (project.plugins.hasPlugin("com.android.application") || project.plugins.hasPlugin("com.android.library")) { + kotlinOptions.jvmTarget = android.compileOptions.sourceCompatibility + } else { + kotlinOptions.jvmTarget = sourceCompatibility } } + } } } \ No newline at end of file