diff --git a/android/build.gradle b/android/build.gradle index 11487135..7a786fa2 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -70,9 +70,16 @@ android { compileSdkVersion safeExtGet('compileSdkVersion', 31) buildToolsVersion safeExtGet('buildToolsVersion', '30.0.2') - compileOptions { - targetCompatibility JavaVersion.VERSION_1_8 - sourceCompatibility JavaVersion.VERSION_1_8 + 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 + } } defaultConfig { @@ -87,6 +94,10 @@ android { } } + buildFeatures { + buildConfig true + } + packagingOptions { exclude "**/libreact_render*.so" }