Skip to content

使用了 MutableList 或者 List ,都不行,都会报错 #42

@a1608626143

Description

@a1608626143
val testList: MutableLiveData<MutableList<String>> by serialLiveData(null)

fun addTest(text: String) {
    val currentList = testList.value ?: mutableListOf()
    currentList.add(text)
    testList.value = currentList
}

使用了 MutableList 或者 List ,都不行,都会报错

kotlinx.serialization.SerializationException: Serializer for class 'ArrayList' is not found.
Please ensure that class is marked as '@serializable' and that the serialization compiler plugin is applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions