java.lang.IllegaLStateException:Source.readString() mest not be null

I'm about to go to the demo soon. When I enter the order list page, it always crashes. The error log is as follows: 

java.lang.RuntimeException: Unable to start activity ComponentInfo{cn.com.henansoft.tripbus/cn.com.henansoft.tripbus.ui.rent.RentCarActivity}: java.lang.IllegalStateException: source.readString() must not be null
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2470)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2532)
    at android.app.ActivityThread.access$900(ActivityThread.java:169)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
    at android.os.Handler.dispatchMessage(Handler.java:111)
    at android.os.Looper.loop(Looper.java:194)
    at android.app.ActivityThread.main(ActivityThread.java:5562)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:968)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:763)
 Caused by: java.lang.IllegalStateException: source.readString() must not be null
    at cn.com.henansoft.tripbus.bean.Order.<init>(Order.kt:30)
    at cn.com.henansoft.tripbus.bean.Order$Companion$CREATOR$1.createFromParcel(Order.kt:58)
    at cn.com.henansoft.tripbus.bean.Order$Companion$CREATOR$1.createFromParcel(Order.kt:57)
    at android.os.Parcel.readParcelable(Parcel.java:2246)
    at android.os.Parcel.readValue(Parcel.java:2146)
    at android.os.Parcel.readArrayMapInternal(Parcel.java:2479)
    at android.os.BaseBundle.unparcel(BaseBundle.java:224)
    at android.os.BaseBundle.getBoolean(BaseBundle.java:662)
    at android.os.Bundle.getBoolean(Bundle.java:603)
    at android.content.Intent.getBooleanExtra(Intent.java:4900)
    at cn.com.henansoft.tripbus.ui.rent.RentCarActivity.initView(RentCarActivity.kt:65)
    at cn.com.henansoft.tripbus.base.BaseActivity.onCreate(BaseActivity.java:107)
    at android.app.Activity.performCreate(Activity.java:6029)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1111)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2423)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2532) 
    at android.app.ActivityThread.access$900(ActivityThread.java:169) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421) 
    at android.os.Handler.dispatchMessage(Handler.java:111) 
    at android.os.Looper.loop(Looper.java:194) 
    at android.app.ActivityThread.main(ActivityThread.java:5562) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at java.lang.reflect.Method.invoke(Method.java:372) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:968) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:763)

The project was written in kotlin, I didn't think about it so much, and then I searched on StackOverflow and found a similar question: https://stackoverflow.com/questions/45688232/illegalstateexception-parcel-readstring-must-not-be-null  ; meaning Yes: Currently, the only workaround is to make the members of the class implementing parcelable nullable. But even if this is done, it still reports an error.

Finally, according to the data returned by the interface, it is found that the data returned by the interface lacks some corresponding fields, so the members of the parcelable class are empty.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324922342&siteId=291194637