Home > Net >  Error With ROOM Database in Android Kotlin
Error With ROOM Database in Android Kotlin

Time:09-28

I am a beginner in android and I am trying to build an app that could fetch from an api but I am facing an error related to Dao , I also tried to read and understand the error but was unable to , please help me with my error , I am getting this error whenever I try to work with Dao and coroutines

Here is the Error

Here is my dao code

here is the error location to which i was directed when i clicked on the error

Article class

CodePudding user response:

You should insert @ColumnInfo top of your DB column like this

@Entity(tableName = "coin_price") @Parcelize data class CoinPrice(

@PrimaryKey
@ColumnInfo(name = "id")
val id: Int,

@ColumnInfo(name = "price")
var price: String? = null

) : Parcelable 

CodePudding user response:

I found a solution but cannot say its the right one , if anyone have any info regarding then please share

I removed the suspend functions in the dao class and changed my appCompat dependency to 1.2.0

  • Related