- flutter create 生成的 android/ ios/ 脚手架入库,服务器/使用者无需再装 Flutter - AndroidManifest:补 INTERNET/录音/存储权限,应用名改「畅联」,开 usesCleartextTraffic(内网 http/ws) - iOS Info.plist:麦克风/相册用途说明、ATS 放行内网明文、显示名「畅联」 - gradle:阿里云镜像优先(本网络 maven.google.com 不可达);统一 Java/Kotlin 编译目标 17; 抬升 livekit_client compileSdk 到 36 以满足 flutter_webrtc 的 AAR 校验 - README 更新为「直接打包」流程
59 lines
1.9 KiB
Kotlin
59 lines
1.9 KiB
Kotlin
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 = "cn.shengshentech.changlian"
|
||
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 = "cn.shengshentech.changlian"
|
||
// 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
|
||
versionCode = flutter.versionCode
|
||
versionName = flutter.versionName
|
||
}
|
||
|
||
buildTypes {
|
||
release {
|
||
// TODO: Add your own signing config for the release build.
|
||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||
signingConfig = signingConfigs.getByName("debug")
|
||
}
|
||
}
|
||
}
|
||
|
||
kotlin {
|
||
compilerOptions {
|
||
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
||
}
|
||
}
|
||
|
||
flutter {
|
||
source = "../.."
|
||
}
|
||
|
||
// livekit_client 插件硬编码 compileSdk = 34,但它依赖的 flutter_webrtc 要求消费者 ≥36,
|
||
// AAR 元数据校验会因此失败。:app 先于各插件求值(根脚本有 evaluationDependsOn(":app")),
|
||
// 所以在插件求值完成后把它的 compileSdk 抬到 36。
|
||
rootProject.subprojects {
|
||
if (name == "livekit_client") {
|
||
afterEvaluate {
|
||
extensions.configure<com.android.build.gradle.LibraryExtension> {
|
||
compileSdk = 36
|
||
}
|
||
}
|
||
}
|
||
}
|