Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Issue updating from v1.5.1 to v1.6.1 for Android #914

@AndroidDeveloperLB

Description

@AndroidDeveloperLB

For some reason, once I update, it complains about that I can't set one of the fields, but I do need to set the field:

@Entity
interface TLThemeResource : Parcelable, Persistable {
    @get:Key
    @get:Generated
    var id: Long
    var url: String
    var width: Int?
    var height: Int?
    val format: String?
    var deviceFilePath: String?
    var type: String

//    @get:OneToOne
//    val theme: TLTheme
}

Usage:

        val tlThemeResourceEntity = TLThemeResourceEntity()
        tlThemeResourceEntity.id=123L

Gradle:

//    https://mvnrepository.com/artifact/io.requery/requery https://github.com/requery/requery
//    final def requery_version = "1.6.1" // can't use this for some reason (something with error: Element "id" is read-only but has setter (Kotlin: change var to val))
    final def requery_version = "1.5.1"
    implementation "io.requery:requery:$requery_version"
    implementation "io.requery:requery-kotlin:$requery_version"
    implementation "io.requery:requery-android:$requery_version"
//    https://mvnrepository.com/artifact/io.requery/requery-processor
    kapt "io.requery:requery-processor:$requery_version"

On 1.5.1, it works fine. Once I use 1.6.1, it wants me to change it to val, but then I can't change it.

The error:

C:\Users\User\Desktop\MyApplication3\app\build\tmp\kapt3\stubs\debug\com\example\myapplication\TLThemeResource.java:11: error: Element "id" is read-only but has setter (Kotlin: change var to val)
    public abstract long getId();

Attached sample here:

My Application.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions