Room cannot find implementation

前端 未结 11 1864
伪装坚强ぢ
伪装坚强ぢ 2020-12-09 07:17

I have a problem with testing a Room database: when I run the test, I get this exception:

java.lang.RuntimeException: cannot find implementation for databa         


        
11条回答
  •  佛祖请我去吃肉
    2020-12-09 07:51

    java.lang.RuntimeException: cannot find implementation for com.example.kermovie.data.repository.local.MoviesDatabase. MoviesDatabase_Impl does not exist

    You have to add teh following code on your build.gradel:

    apply plugin: 'kotlin-kapt' 
    
    dependencies {
        implementation 'androidx.room:room-runtime:2.2.5'
        implementation "androidx.room:room-ktx:2.2.5"
        kapt "androidx.room:room-compiler:2.2.5"
    }
    

提交回复
热议问题