I am trying to use the Room persistence library in my application but I have trouble with injection using KOIN. Does someone have an experience with such integration? I followed this TUTORIAL but I ended up with the following exception:
org.koin.error.DependencyResolutionException: Cyclic call while resolving Bean[class=com.freyja.client.database.RecordDatabase]. Definition is already in resolution in current call
I am the following definitions:
@Database(entities = [Record::class], version = 1)
abstract class RecordDatabase: RoomDatabase() {
abstract fun recordDao(): RecordDao
}
@Dao
interface RecordDao {
@Query("SELECT * from record WHERE recordId= :recordId LIMIT 1")
fun get(recordId: Int): Record
}
I resolved my problem with using kapt "android.arch.persistence.room:compiler:$roomVersion" instead of annotationProcessor. It seems that it was a Koltin issue after all.
Question about Architecture Components?
I am trying to use the Room persistence library in my application but I have trouble with injection using KOIN. Does someone have an experience with such integration? I followed this TUTORIAL but I ended up with the following exception:
I am the following definitions:
and my Koin modules definition contains:
dependencies: