Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 16 additions & 19 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,43 +34,41 @@ if (flutterVersionName == null) {
}

android {
namespace 'com.rtirl.chat'
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
namespace = 'com.rtirl.chat'
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

defaultConfig {
applicationId "com.rtirl.chat"
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode vcode
versionName flutterVersionName
multiDexEnabled true
applicationId = "com.rtirl.chat"
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = vcode
versionName = flutterVersionName
}

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
keyAlias = keystoreProperties['keyAlias']
keyPassword = keystoreProperties['keyPassword']
storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword = keystoreProperties['storePassword']
}
}

buildTypes {
release {
signingConfig signingConfigs.release
signingConfig = signingConfigs.release
}
}
namespace 'com.rtirl.chat'
}

kotlin {
Expand All @@ -80,12 +78,11 @@ kotlin {
}

flutter {
source '../..'
source = '../..'
}

dependencies {
implementation "androidx.media:media:1.7.1"
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.google.android.play:app-update:2.1.0'
implementation 'com.google.android.play:feature-delivery:2.1.0'
}
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
org.gradle.caching=true
# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=false
# This newDsl flag was added automatically by Flutter migrator
Expand Down
6 changes: 3 additions & 3 deletions packages/on_device_tts/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ plugins {
// parity and emulator tests when you do.
val onnxRuntimeVersion = "1.31.0"

android {
configure<com.android.build.api.dsl.LibraryExtension> {
namespace = "com.muxable.ondevicetts"

compileSdk = 36
Expand All @@ -41,10 +41,10 @@ android {

sourceSets {
getByName("main") {
java.srcDirs("src/main/kotlin")
java.directories.add("src/main/kotlin")
}
getByName("test") {
java.srcDirs("src/test/kotlin")
java.directories.add("src/test/kotlin")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ class SystemTtsPlugin : MethodCallHandler, FlutterPlugin {
val file = File(fileName)
fullPath = file.path

tts!!.synthesizeToFile(text, bundle!!, file!!, SYNTHESIZE_TO_FILE_PREFIX + uuid)
tts!!.synthesizeToFile(text, bundle!!, file, SYNTHESIZE_TO_FILE_PREFIX + uuid)
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
val resolver = this.context?.contentResolver
val contentValues = ContentValues().apply {
Expand All @@ -739,7 +739,7 @@ class SystemTtsPlugin : MethodCallHandler, FlutterPlugin {
val file = File(musicDir, fileName)
fullPath = file.path

tts!!.synthesizeToFile(text, bundle!!, file!!, SYNTHESIZE_TO_FILE_PREFIX + uuid)
tts!!.synthesizeToFile(text, bundle!!, file, SYNTHESIZE_TO_FILE_PREFIX + uuid)
}

if (result == TextToSpeech.SUCCESS) {
Expand Down Expand Up @@ -804,6 +804,8 @@ class SystemTtsPlugin : MethodCallHandler, FlutterPlugin {
.build()
audioManager?.requestAudioFocus(audioFocusRequest!!)
} else {
// minSdk is 24; AudioFocusRequest needs API 26.
@Suppress("DEPRECATION")
audioManager?.requestAudioFocus(null, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK)
}
}
Expand All @@ -812,6 +814,7 @@ class SystemTtsPlugin : MethodCallHandler, FlutterPlugin {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
audioFocusRequest?.let { audioManager?.abandonAudioFocusRequest(it) }
} else {
@Suppress("DEPRECATION")
audioManager?.abandonAudioFocus(null)
}
}
Expand Down
Loading