diff --git a/android/build.gradle b/android/build.gradle index 302170d..c499fa3 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,7 +21,11 @@ rootProject.allprojects { } apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' + +def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int +if (agpMajor < 9) { + apply plugin: 'kotlin-android' +} android { if (project.android.hasProperty('namespace')) { @@ -48,8 +52,10 @@ android { targetCompatibility JavaVersion.VERSION_1_8 } - kotlinOptions { - jvmTarget = '1.8' + if (agpMajor < 9) { + kotlinOptions { + jvmTarget = '1.8' + } } }