Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions package/expo-package/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,13 @@ android {
}

compileOptions {
// Must match the Kotlin jvmTarget below. AGP 9 (React Native 0.87) fails the build on an
// inconsistent JVM-target between the Java and Kotlin compilation tasks.
// Must match the Kotlin jvmTarget set on the KotlinCompile tasks below: an inconsistent
// JVM-target between the Java and Kotlin compilation tasks fails the build. On AGP 9 this
// is also what AGP's built-in Kotlin derives the Kotlin jvmTarget from.
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
}

sourceSets {
main {
if (isNewArchitectureEnabled()) {
Expand Down Expand Up @@ -128,6 +125,12 @@ tasks.matching { it.name == "preBuild" }.configureEach {

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
dependsOn("syncSharedShimmerSources")
// Set here rather than via `android.kotlinOptions`: that DSL is contributed by the Kotlin
// Gradle plugin, which is deliberately not applied when AGP registers the `kotlin`
// extension itself (see the guard at the top of this file). This form works either way.
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
}

repositories {
Expand Down
15 changes: 9 additions & 6 deletions package/native-package/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,13 @@ android {
}

compileOptions {
// Must match the Kotlin jvmTarget below. AGP 9 (React Native 0.87) fails the build on an
// inconsistent JVM-target between the Java and Kotlin compilation tasks.
// Must match the Kotlin jvmTarget set on the KotlinCompile tasks below: an inconsistent
// JVM-target between the Java and Kotlin compilation tasks fails the build. On AGP 9 this
// is also what AGP's built-in Kotlin derives the Kotlin jvmTarget from.
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
}

sourceSets {
main {
if (isNewArchitectureEnabled()) {
Expand Down Expand Up @@ -141,6 +138,12 @@ tasks.matching { it.name == "preBuild" }.configureEach {

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
dependsOn("syncSharedShimmerSources")
// Set here rather than via `android.kotlinOptions`: that DSL is contributed by the Kotlin
// Gradle plugin, which is deliberately not applied when AGP registers the `kotlin`
// extension itself (see the guard at the top of this file). This form works either way.
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
}

repositories {
Expand Down