Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changes/agp9-built-in-kotlin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
patch type="fixed" "Android plugin compatibility with AGP 9 built-in Kotlin"
16 changes: 11 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ 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")) {
Expand All @@ -36,10 +40,6 @@ android {
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}

sourceSets {
main.java.srcDirs += "src/main/kotlin"
test.java.srcDirs += "src/test/kotlin"
Expand Down Expand Up @@ -68,3 +68,9 @@ android {
}
}
}

kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
}
}
Loading