Skip to content
Open
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
22 changes: 17 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,17 @@ rootProject.allprojects {
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

// AGP 9+ ships built-in Kotlin support and registers its own `kotlin { }` extension,
// which conflicts with the classic 'kotlin-android' plugin unless the app has opted
// out via `android.builtInKotlin=false` in gradle.properties (Flutter's current
// recommended interim state; see https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-plugin-authors).
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
def builtInKotlinOptedOut = project.hasProperty('android.builtInKotlin') &&
!Boolean.parseBoolean(project.property('android.builtInKotlin').toString())
if (agpMajor < 9 || builtInKotlinOptedOut) {
apply plugin: 'kotlin-android'
}

android {
namespace "dev.note11.flutter_naver_map.flutter_naver_map"
Expand All @@ -37,10 +47,6 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
Expand All @@ -54,3 +60,9 @@ android {
implementation 'com.google.android.gms:play-services-location:21.3.0'
}
}

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