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
  • Loading branch information
Alex Risch authored and Alex Risch committed Jan 10, 2024
1 parent 7d0bf2d commit 654a018
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,16 @@ afterEvaluate {
android {
compileSdkVersion safeExtGet("compileSdkVersion", 31)

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 654a018

Please sign in to comment.