Trying to figure out how to add Rooms but Studio is very upset. Cannot find a guide which actually works.

This commit is contained in:
Hyperling 2024-07-20 13:09:52 -07:00
parent 32b07eade6
commit 83e182076b
3 changed files with 22 additions and 1 deletions

View File

@ -1,6 +1,9 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
// https://medium.com/@rowaido.game/implementing-the-room-library-with-jetpack-compose-590d13101fa7
id("com.google.devtools.ksp")
}
android {
@ -41,6 +44,9 @@ android {
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.1"
// https://medium.com/@rowaido.game/implementing-the-room-library-with-jetpack-compose-590d13101fa7
//kotlinCompilerExtensionVersion = "1.5.11"
}
packaging {
resources {
@ -66,4 +72,13 @@ dependencies {
androidTestImplementation(libs.androidx.ui.test.junit4)
debugImplementation(libs.androidx.ui.tooling)
debugImplementation(libs.androidx.ui.test.manifest)
}
// https://medium.com/@rowaido.game/implementing-the-room-library-with-jetpack-compose-590d13101fa7
/* This is crazy? How are people supposed to know how to do this, and especially "fix" it when it doesn't work?
implementation(libs.androidx.room.runtime)
implementation(libs.androidx.room.ktx)
ksp(libs.androidx.room.compiler)
implementation(libs.androidx.lifecycle.viewmodel.compose)
*/
}

View File

@ -2,4 +2,7 @@
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.jetbrains.kotlin.android) apply false
// https://medium.com/@rowaido.game/implementing-the-room-library-with-jetpack-compose-590d13101fa7
id("com.google.devtools.ksp") version "1.9.23-1.0.19" apply false
}

View File

@ -8,6 +8,9 @@ espressoCore = "3.5.1"
lifecycleRuntimeKtx = "2.6.1"
activityCompose = "1.8.0"
composeBom = "2024.04.01"
roomCompiler = "2.6.1"
roomKtx = "2.6.1"
roomRuntime = "2.6.1"
[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }