repositories { google() mavenCentral() maven { url = uri("https://artifact.bytedance.com/repository/Volcengine/") } } plugins { id("com.android.application") id("kotlin-android") // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id("dev.flutter.flutter-gradle-plugin") } android { namespace = "com.example.deep_voice" compileSdk = 35 ndkVersion = "28.0.13004108" compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 // Enable core library desugaring isCoreLibraryDesugaringEnabled = true } kotlinOptions { jvmTarget = JavaVersion.VERSION_11.toString() } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId = "com.example.deep_voice" // You can update the following values to match your application needs. // For more information, see: https://flutter.dev/to/review-gradle-config. minSdk = 24 // Updated to meet azure_speech_recognition_null_safety requirements targetSdk = 33 // 设置为 Android 13 (API 33),以匹配 FOREGROUND_SERVICE_MEDIA_PLAYBACK 权限的要求 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") } } } dependencies { // 添加OkHttp依赖 implementation("com.squareup.okhttp3:okhttp:4.9.3") // 添加核心库反糖化 coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3") // Microsoft 语音识别SDK implementation("com.microsoft.cognitiveservices.speech:client-sdk:1.42.0") // 添加androidx.media依赖 implementation("androidx.media:media:1.6.0") // 添加legacy-support-v4依赖 implementation("androidx.legacy:legacy-support-v4:1.0.0") // 添加 AndroidX Security 加密 SharedPreferences 依赖 implementation("androidx.security:security-crypto:1.1.0-alpha06") // // 添加火山语音合成SDK依赖 // implementation("com.bytedance.speechengine:speechengine_tts_tob:5.4.8") // 添加火山语音识别SDK依赖 // implementation("com.bytedance.speechengine:speechengine_tob:0.0.5") } flutter { source = "../.." }