plugins { id("com.android.application") // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id("dev.flutter.flutter-gradle-plugin") } android { namespace = "com.lxh.qingting_player" compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId = "com.lxh.qingting_player" // You can update the following values to match your application needs. // For more information, see: https://flutter.dev/to/review-gradle-config. minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion // Uses the version code from pubspec.yaml. When using split APKs, 1000 * ABI_VERSION // is added automatically by Flutter. (https://developer.android.com/studio/build/configure-apk-splits#configure-APK-versions) // You can force using the value of versionCode by specifying the `-P force-version-code-ignoring-abi=true` // flag during build. versionCode = flutter.versionCode versionName = flutter.versionName // 与 main 分支保持一致:仅打包 arm64-v8a ndk { abiFilters.addAll(listOf("arm64-v8a")) } } // AGP 9 不再允许在 AndroidManifest 里写 android:extractNativeLibs, // 改为在这里声明,效果等价于原先的“强制提取 .so” packaging { jniLibs { useLegacyPackaging = true } } // AGP 9 默认关闭 resValue 生成,这里显式打开(debug 需要 "清听 Dev" 的应用名) buildFeatures { resValues = true } buildTypes { debug { // 测试包与正式包并存安装:com.lxh.qingting_player.dev // 说明:Android 包名每一段必须以字母开头,所以没法直接写 "_dev", // 这里用 ".dev" 后缀,等价于给 debug 打上 dev 标记。 applicationIdSuffix = ".dev" resValue("string", "app_name", "清听 Dev") } release { // TODO: 上线前换成正式签名(当前沿用 debug keystore) resValue("string", "app_name", "清听") signingConfig = signingConfigs.getByName("debug") } } } kotlin { compilerOptions { jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 } } flutter { source = "../.." }