A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution

前端 未结 30 1826
南旧
南旧 2020-12-12 20:01

All of sudden I start getting this error, and I am not getting idea why if anyone just let me know where this error is, will be enough helpful. As much I am able to get is t

30条回答
  •  爱一瞬间的悲伤
    2020-12-12 20:35

    For me, the issue was with having 2 primary keys defined on the model.

    // before    
    @field:ColumnInfo(name = "id") @field:PrimaryKey(autoGenerate = true) var id: Long = 0,
    @field:ColumnInfo(name = "name") @field:PrimaryKey var name: String,
        
    //after
    @field:ColumnInfo(name = "id") @field:PrimaryKey(autoGenerate = true) var id: Long = 0,
    @field:ColumnInfo(name = "name") @field:NotNull var name: String,
    

    I had to rebuild the project and change the Dao class a little bit to trigger the message about the issue.

提交回复
热议问题