小编Ahm*_*rim的帖子

平台类android(无注释)需要显式注册JsonAdapter

尽管我从 udacity 获得了另一个代码并且我完全按照在那里完成的方式进行了几天,但仍然出现相同的错误。我错过了什么吗?

I have searched everywhere and tried many ways to solve this problem but i still get the same error "requires explicit JsonAdapter to be registered". I tried rebuild project, sync with file system, delete the dependencies and sync again BUT it never worked.

数据类

import android.os.Parcelable
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import kotlinx.android.parcel.Parcelize

@Parcelize
data class Post(

    @Json(name = "id") var postId: Int,

    val title: String,

    val userId: Int,

    val postDate: String,

    val location: String,

    @Json(name = "pictureUrl") …
Run Code Online (Sandbox Code Playgroud)

android kotlin

7
推荐指数
0
解决办法
1481
查看次数

标签 统计

android ×1

kotlin ×1