Room Persistence Library run time exception when calling Rooms inMemoryBuilder method

前端 未结 8 929
不思量自难忘°
不思量自难忘° 2020-12-09 16:13

When following the tutorial for setting up the Room persistence library I run in to this error when testing on an Android device.

java.lang.RuntimeException: cannot

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-09 16:27

    Had the same issue with

    • gradle 3.2.0-alpha09
    • koltin 1.2.31

    Due the removal of apply plugin: 'kotlin-kapt' and other buggy stuff.. I had to downgrade to kotlin 1.1.60 to make it work. Then use:

    apply plugin: 'kotlin-kapt'
    
    dependencies {
        ...
        implementation 'android.arch.persistence.room:runtime:1.0.0'
        kapt "android.arch.persistence.room:compiler:1.0.0"
    }
    

    an other option would be to write the DB entities/DAOs and DataBase in Java instead.

提交回复
热议问题