File tree Expand file tree Collapse file tree
packages/firebase_ai/firebase_ai/android Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ version '1.0-SNAPSHOT'
44apply plugin : ' com.android.library'
55apply from : file(" local-config.gradle" )
66
7+ // AGP 9+ has built-in Kotlin support; older versions need the plugin explicitly.
8+ def agpMajor = com.android.Version . ANDROID_GRADLE_PLUGIN_VERSION . tokenize(' .' )[0 ] as int
9+ if (agpMajor < 9 ) {
10+ apply plugin : ' kotlin-android'
11+ }
12+
713buildscript {
814 repositories {
915 google()
@@ -16,20 +22,25 @@ android {
1622 namespace ' io.flutter.plugins.firebase.ai'
1723 }
1824
19- compileSdk project. ext. compileSdk
25+ compileSdkVersion project. ext. compileSdk
2026
2127 defaultConfig {
2228 minSdkVersion project. ext. minSdk
23- targetSdkVersion project. ext. targetSdk
2429 }
2530
2631 compileOptions {
2732 sourceCompatibility project. ext. javaVersion
2833 targetCompatibility project. ext. javaVersion
2934 }
3035
31- kotlinOptions {
32- jvmTarget = project. ext. javaVersion
36+ if (agpMajor < 9 ) {
37+ kotlinOptions {
38+ jvmTarget = project. ext. javaVersion
39+ }
40+ }
41+
42+ sourceSets {
43+ main. java. srcDirs + = " src/main/kotlin"
3344 }
3445
3546 lintOptions {
You can’t perform that action at this time.
0 commit comments