Не знаю, что не так с проблемой ниже?
Код:
CategoryDAO.kt
@Dao
interface CategoryDAO {
@Query("select * from CategoryDesign")
suspend fun getCategory(): MutableLiveData<List<CategoryDesign>>
}
CategoryDesign.kt
@Entity
data class CategoryDesign (
@PrimaryKey
var categoryDesignID:String,
var designImage:String,
var designTitle:String){
constructor() : this("","","")
override fun toString(): String {
return designTitle
}
}
Нажмите кнопку «Запустить приложение», чтобы отобразить ошибку, как показано ниже:
error: Not sure how to convert a Cursor to this method's return type (androidx.lifecycle.MutableLiveData<java.util.List<com.squall.searchdesigner.model.CategoryDesign>>).
public abstract java.lang.Object getCategory(@org.jetbrains.annotations.NotNull()
w: [kapt] Incremental annotation processing requested, but support is disabled because the following processors are not incremental: androidx.room.RoomProcessor (DYNAMIC), android.databinding.annotationprocessor.ProcessDataBinding (DYNAMIC).
зависимости:
dependencies {
def room_version = "2.2.3"
kapt "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-ktx:$room_version"
}