com.alibaba.fastjson.JSONException: default constructor not found.

ohfgkhjo  于 2021-11-27  发布在  Java
关注(0)|答案(1)|浏览(806)

Android Studio: 3.1
android gradle version: 3.1.0
fastjson version: 1.2.47
kotlin version:1.2.31

kotlin data class like this

class VRouterParams {
    var fragmentRoute: String? = null
    var params: Map<*, *>? = null
    var backTag: String? = null
    var fitWindow: Boolean = false
    var animatorType: Int = 1// 0 no animation , 1 right in , 2 bottom in
}

parse failed

kotlin data class like this

class VRouterParams {
    constructor()
    constructor(fragmentRoute: String?,params: Map<String, *>?,backTag: String?,fitWindow: Boolean,animatorType: Int) {
        this.fragmentRoute = fragmentRoute
        this.params = params
        this.backTag = backTag
        this.fitWindow = fitWindow
        this.animatorType = animatorType
    }
    var fragmentRoute: String? = null
    var params: Map<*, *>? = null
    var backTag: String? = null
    var fitWindow: Boolean = false
    var animatorType: Int = 1// 0 no animation , 1 right in , 2 bottom in
}

parse pass

rfbsl7qr

rfbsl7qr1#

Have you solved your problem?
I have the same problem in java。
When I release my app。

相关问题