Skip to content

Commit

Permalink
fix: Android Build for React Native 0.73 (#288)
Browse files Browse the repository at this point in the history
With React Native 0.73 Android Gradle Plugin 8 is now supported
If 8 and up the java toolchain should take care of the compatibility of java versions between dependencies

Release: react-native-community/discussions-and-proposals#671

Fixes Error: 'compileDebugJavaWithJavac' task (current target is 17) and 'compileDebugKotlin' task (current target is 11) jvm target compatibility

Seen when building for Android

Co-authored-by: Alex Risch <alexrisch@Alexs-MacBook-Pro-2.local>
  • Loading branch information
7CodeWizard and Alex Risch committed Jan 25, 2024
1 parent 1998d18 commit 681b92e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions react-native/client/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ afterEvaluate {
android {
compileSdkVersion safeExtGet("compileSdkVersion", 33)

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_11
targetCompatibility JavaVersion.VERSION_11
}

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

namespace "expo.modules.coinbasewalletsdkexpo"
Expand Down

0 comments on commit 681b92e

Please sign in to comment.