Error:Not sure how to convert a Cursor to this method\'s return type
Error:Execution failed for task \':app:compileDebugJavaWithJavac\'.
Compilation failed; see the
For anyone landing here, using a coroutine Flow as a return type, you will get this error if you accidentally make the function suspend. Since it is returning a flow, there is no need to suspend.
So instead of this:
@Query("SELECT * FROM myTable WHERE id = :id")
suspend fun findById(id: Long): Flow
use this (without suspend modifier):
@Query("SELECT * FROM myTable WHERE id = :id")
fun findById(id: Long): Flow