in Файл gradle:
Код: Выделить всё
kotlin {
experimental {
coroutines 'enable'
}
}
dependencies { implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:0.21" ...}
класс дао
Код: Выделить всё
@Query("select * from myevent")
suspend fun all(): List
@Delete
suspend fun deleteEvent(event: MyEvent)
...
ошибку
Код: Выделить всё
e: C:\Users\projectpath\app\build\tmp\kapt3\stubs\debug\com\robyn\myapp\data\source\local\EventsDao.java:39: error: Deletion methods must either return void or return int (the number of deleted rows).
public abstract java.lang.Object deleteEventById(@org.jetbrains.annotations.NotNull()
^
e: C:\Users\projectpath\app\build\tmp\kapt3\stubs\debug\com\robyn\myapp\data\source\local\EventsDao.java:41: error: Query method parameters should either be a type that can be converted into a database column or a List / Array that contains such type. You can consider adding a Type Adapter for this.
kotlin.coroutines.experimental.Continuation
Подробнее здесь: [url]https://stackoverflow.com/questions/48694449/error-with-room-dao-class-when-using-kotlin-coroutines[/url]
Мобильная версия