google-developer-training / basic-android-kotlin-compose-training-inventory-app

Apache License 2.0
77 stars 84 forks source link

Persist data with Room #27

Open MatanShvide opened 1 year ago

MatanShvide commented 1 year ago

URL of codelab: https://developer.android.com/codelabs/basic-android-kotlin-compose-persisting-data-room?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-6-pathway-2%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-persisting-data-room#7

Specify the language of the codelab if it is not English:

In which task and step of the codelab can this issue be found? In link

Describe the problem I still get the following errors for the build although I checked that my code is similar to the solution code at this point: failed :app:kspDebugKotlin [ksp] C:/Users/medy/Downloads/basic-android-kotlin-compose-training-inventory-app-starter/basic-android-kotlin-compose-training-inventory-app-starter/app/src/main/java/com/example/inventory/data/ItemDao.kt:18: There is a problem with the query: [SQLITE_ERROR] SQL error or missing database (no such table: item) [ksp] C:/Users/medy/Downloads/basic-android-kotlin-compose-training-inventory-app-starter/basic-android-kotlin-compose-training-inventory-app-starter/app/src/main/java/com/example/inventory/data/ItemDao.kt:18: Not sure how to convert a Cursor to this method's return type (kotlinx.coroutines.flow.Flow). [ksp] C:/Users/medy/Downloads/basic-android-kotlin-compose-training-inventory-app-starter/basic-android-kotlin-compose-training-inventory-app-starter/app/src/main/java/com/example/inventory/data/ItemDao.kt:21: There is a problem with the query: [SQLITE_ERROR] SQL error or missing database (no such table: item) [ksp] C:/Users/medy/Downloads/basic-android-kotlin-compose-training-inventory-app-starter/basic-android-kotlin-compose-training-inventory-app-starter/app/src/main/java/com/example/inventory/data/ItemDao.kt:21: Not sure how to convert a Cursor to this method's return type (kotlinx.coroutines.flow.Flow<java.util.List>). org.jetbrains.kotlin.gradle.tasks.CompilationErrorException: Compilation error. See log for more details Compilation error

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions Android Studio version: API version of the emulator:

Additional information Include screenshots if they would be useful in clarifying the problem.

android-dev-lxl commented 1 year ago

@MatanShvide Thank you for reaching out to us. Could you please copy-paste your DAO class?