diff --git a/starter/android/build.gradle b/starter/android/build.gradle index 5bcda9e35..fff94a155 100644 --- a/starter/android/build.gradle +++ b/starter/android/build.gradle @@ -20,12 +20,35 @@ allprojects { rootProject.buildDir = '../build' subprojects { + afterEvaluate { project -> + if (project.extensions.findByName("android") != null) { + Integer pluginCompileSdk = project.android.compileSdk + if (pluginCompileSdk != null && pluginCompileSdk < 34) { + + def javaVersion = JavaVersion.VERSION_17 + project.android { + compileSdk 34 + if (namespace == null) { + namespace project.group + } + compileOptions { + sourceCompatibility javaVersion + targetCompatibility javaVersion + } + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { + kotlinOptions { + jvmTarget = javaVersion.toString() + } + } + } + } + } + } + project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') + project.evaluationDependsOn(":app") } tasks.register("clean", Delete) { delete rootProject.buildDir -} \ No newline at end of file +}