Skip to content

Commit

Permalink
feat: Added support for Java 17
Browse files Browse the repository at this point in the history
Fix issue:

> 'compileDebugJavaWithJavac' task (current target is 17) and 'compileDebugKotlin' task (current target is 11) jvm target compatibility should be set to the same Java version.

Seen when working with React Native 0.73 project
Bumped compile sdk to 34
  • Loading branch information
Alex Risch authored and Alex Risch committed Jan 13, 2024
1 parent 7d0bf2d commit 9c65831
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,18 @@ afterEvaluate {
}

android {
compileSdkVersion safeExtGet("compileSdkVersion", 31)
compileSdkVersion safeExtGet("compileSdkVersion", 34)

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
if (agpVersion.tokenize('.')[0].toInteger() < 8) {
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.majorVersion
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.majorVersion
}
}

defaultConfig {
Expand Down

0 comments on commit 9c65831

Please sign in to comment.