diff --git a/android/build.gradle b/android/build.gradle index 0e043147f..4461d0663 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -56,4 +56,29 @@ allprojects { google() maven { url 'https://www.jitpack.io' } } +} + +subprojects { + afterEvaluate { project -> + if (project.hasProperty("android")) { + android { + buildToolsVersion "34.0.0" + compileSdkVersion 33 + defaultConfig { + minSdkVersion 24 + } + } + } + + // Check if the project name is 'rn-ldk' before applying the Kotlin compile options + if (project.name == 'rn-ldk') { + 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