group = "dev.fluttercommunity.plus.packageinfo" version = "1.0-SNAPSHOT" buildscript { val kotlinVersion = "2.2.0" repositories { google() mavenCentral() } dependencies { classpath("com.android.tools.build:gradle:8.12.1") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") } } allprojects { repositories { google() mavenCentral() } } plugins { id("com.android.library") } val agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.substringBefore('.').toInt() // AGP 9 provides Kotlin support natively unless the consuming app opts out with // android.builtInKotlin=false, which is what `flutter create` writes by default. val builtInKotlinEnabled = agpMajor >= 9 && (providers.gradleProperty("android.builtInKotlin").orNull?.toBoolean() ?: true) if (!builtInKotlinEnabled) { apply(plugin = "org.jetbrains.kotlin.android") } project.extensions.configure(org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension::class.java) { compilerOptions { jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 } } android { namespace = "dev.fluttercommunity.plus.packageinfo" compileSdk = flutter.compileSdkVersion compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } defaultConfig { minSdk = 19 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } lint { disable.add("InvalidPackage") } }