diff --git a/android/build.gradle b/android/build.gradle index bdfb96053..e62d7965c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -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 {