SatsAmp/app/build.gradle.kts
avi bf9222ab0d fix(playlists): re-adding a song to a playlist crashed with SQLiteConstraintException
(playlistId, songId) is the playlist_songs PK, so a second @Insert of the
same pair threw UNIQUE constraint failed and killed the app (reproduced
twice in the crash buffer on 10-03). Switch to OnConflictStrategy.IGNORE:
duplicate add is now a silent no-op. Verified on-device on 0.1.5 (7):
re-adding 'The Humbling River' to FAVORITES keeps the song list intact,
0 FATALs, no new crash-buffer entries.
2026-10-03 19:43:44 -05:00

139 lines
5.3 KiB
Kotlin

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("org.jetbrains.kotlin.plugin.compose")
id("org.jetbrains.kotlin.plugin.serialization")
id("com.google.dagger.hilt.android")
id("com.google.devtools.ksp")
}
android {
namespace = "com.rada"
compileSdk = 35
defaultConfig {
applicationId = "com.rada"
minSdk = 26
targetSdk = 35
versionCode = 7
versionName = "0.1.5"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = true
// Personal test builds: sign release with the debug key so it can
// be installed directly. Production releases must use a real key.
signingConfig = signingConfigs.getByName("debug")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
packaging {
// The secp256k1 binding fails to initialize when loaded directly from
// the APK on some Android 17 devices. Extract JNI libraries so the
// platform linker loads the file from the app's native directory.
jniLibs {
useLegacyPackaging = true
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
compose = true
buildConfig = true
}
}
dependencies {
// Compose BOM
val composeBom = platform("androidx.compose:compose-bom:2024.12.01")
implementation(composeBom)
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
implementation("androidx.compose.material:material-icons-extended")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")
// Core
implementation("androidx.core:core-ktx:1.15.0")
implementation("androidx.documentfile:documentfile:1.0.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.8.7")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.7")
implementation("androidx.activity:activity-compose:1.9.3")
// QR scanning for Nostr Wallet Connect pairing strings.
implementation("androidx.camera:camera-camera2:1.4.1")
implementation("androidx.camera:camera-lifecycle:1.4.1")
implementation("androidx.camera:camera-view:1.4.1")
implementation("com.google.mlkit:barcode-scanning:17.3.0")
// Navigation
implementation("androidx.navigation:navigation-compose:2.8.5")
// Hilt
implementation("com.google.dagger:hilt-android:2.52")
ksp("com.google.dagger:hilt-android-compiler:2.52")
implementation("androidx.hilt:hilt-navigation-compose:1.2.0")
// Media3 (ExoPlayer)
implementation("androidx.media3:media3-exoplayer:1.5.1")
implementation("androidx.media3:media3-session:1.5.1")
implementation("androidx.media3:media3-ui:1.5.1")
// OkHttp
implementation("com.squareup.okhttp3:okhttp:4.12.0")
// Room (persistence layer: RadAmpDatabase / SavedSongDao / SavedSongEntity).
// Pre-existing gap: the data layer uses androidx.room but no Room
// dependency was declared, so the build could never resolve Room types
// (it was previously masked because dependency resolution failed earlier
// on the jaudiotagger group). 2.8.4 is the version present in the local
// Gradle cache; room-ktx provides the suspend/Flow DAO helpers, and
// room-compiler (via KSP) generates the Room implementation.
implementation("androidx.room:room-runtime:2.8.4")
implementation("androidx.room:room-ktx:2.8.4")
ksp("androidx.room:room-compiler:2.8.4")
// Kotlinx Serialization
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
// Coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
// Audio metadata (ID3 tags).
// NOTE: jaudiotagger is published under the Maven group `net.jthink` — the
// Java *package* is still `org.jaudiotagger.*` (the imports above are
// correct); only the dependency group was wrong (`org.jaudiotagger` does
// not exist on Maven Central), which made the build fail during
// dependency resolution before Kotlin was ever compiled.
implementation("net.jthink:jaudiotagger:2.2.5")
// Nostr/Lightning crypto: BIP-340 schnorr + ECDH via ACINQ's secp256k1
// Kotlin-multiplatform binding (prebuilt .so for all Android ABIs).
implementation("fr.acinq.secp256k1:secp256k1-kmp:0.17.3")
implementation("fr.acinq.secp256k1:secp256k1-kmp-jni-android:0.17.3")
// Testing
testImplementation("junit:junit:4.13.2")
testImplementation("fr.acinq.secp256k1:secp256k1-kmp-jni-jvm-extract:0.17.3")
testImplementation("fr.acinq.secp256k1:secp256k1-kmp-jni-jvm-linux:0.17.3")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation(composeBom)
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
}