Skip to content

Commit

Permalink
Added java 11 backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
gosha212 committed Apr 2, 2024
1 parent 4408006 commit 7d39ba4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
if (reactNativeMinorVersion() >= 73) {
jvmTarget = JavaVersion.VERSION_17
} else {
jvmTarget = JavaVersion.VERSION_11
}
}

flavorDimensions "RNN.reactNativeVersion"
Expand Down Expand Up @@ -110,6 +114,9 @@ android {
reactNative71 {
dimension "RNN.reactNativeVersion"
buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "71")
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}
}
}

Expand All @@ -122,6 +129,11 @@ android {
}
}

int reactNativeMinorVersion() {
List reactNativeVersionComponents = reactNativeVersionComponents(findReactNativePackageJson())
reactNativeVersionComponents[1].toInteger()
}

String resolveFlavor() {
List reactNativeVersionComponents = reactNativeVersionComponents(findReactNativePackageJson())
Integer reactNativeMinorComponent = reactNativeVersionComponents[1].toInteger()
Expand Down

0 comments on commit 7d39ba4

Please sign in to comment.