android - Parcelable encountered IOException writing serializable object [QUICKBLOX DIALOG] -


i facing issue in quickblox since 15th april, when quickblox updated sdk android 2.5.2. problem noticed like, if have customdata parameter filled dialog, throws ioexeption mentioned below. else no issues.

dialog casues no issues.

qbdialog{id=xxxx, created_at=2016-19-04 11:36:54, last_msg_user_id=xxxx, occupants_ids=[xxxx, xxxx, last_message=hey, last_message_date_sent=1461046124, type=private, name=xxxx, room_jid=null, user_id=xxxx, photo=null, unread_message_count=0, customdata=null}

dialog causes crash.

qbdialog{id=xxxx, created_at=2016-19-04 12:01:00, last_msg_user_id=xxxx, occupants_ids=[xxxx, xxxx], last_message=hello, last_message_date_sent=1461047494, type=private, name=xxxx, room_jid=null, user_id=xxxx, photo=null, unread_message_count=1, customdata=qbbasecustomobject{classname='dialoguerelationstate', fields={isfriends=true, location_field=null}}}

code segment passes dialogs above activity_chat class

bundle bundle = new bundle(); bundle.getstring(selecteddialog.tostring()); bundle.putserializable(activity_chat.extra_dialog, selecteddialog); activity_chat.start(drawactivity_chatlist.this, bundle);// error points here 

start method of receiving activity

public static void start(context context, bundle bundle) {      intent intent = new intent(context, activity_chat.class);     intent.putextras(bundle);     context.startactivity(intent); //error points here } 

error log:

fatal exception: java.lang.runtimeexception: parcelable encountered ioexception writing serializable object (name = com.quickblox.chat.model.qbdialog)        @ android.os.parcel.writeserializable(parcel.java:1323)        @ android.os.parcel.writevalue(parcel.java:1271)        @ android.os.parcel.writearraymapinternal(parcel.java:618)        @ android.os.bundle.writetoparcel(bundle.java:1692)        @ android.os.parcel.writebundle(parcel.java:643)        @ android.content.intent.writetoparcel(intent.java:7152)        @ android.app.activitymanagerproxy.startactivity(activitymanagernative.java:2663)        @ android.app.instrumentation.execstartactivity(instrumentation.java:1419)        @ android.app.activity.startactivityforresult(activity.java:3532)        @ android.app.activity.startactivityforresult(activity.java:3458)        @ android.support.v4.app.fragmentactivity.startactivityforresult(fragmentactivity.java:784)        @ android.app.activity.startactivity(activity.java:3780)        @ android.app.activity.startactivity(activity.java:3748)        @ com.social.fitspur.activities.activity_chat.start(activity_chat.java:100)        @ com.social.fitspur.activities.drawactivity_chatlist$3.onitemclick(drawactivity_chatlist.java:198)        @ android.widget.adapterview.performitemclick(adapterview.java:299)        @ android.widget.abslistview.performitemclick(abslistview.java:1162)        @ android.widget.abslistview$performclick.run(abslistview.java:2953)        @ android.widget.abslistview$3.run(abslistview.java:3708)        @ android.os.handler.handlecallback(handler.java:733)        @ android.os.handler.dispatchmessage(handler.java:95)        @ android.os.looper.loop(looper.java:149)        @ android.app.activitythread.main(activitythread.java:5257)        @ java.lang.reflect.method.invokenative(method.java)        @ java.lang.reflect.method.invoke(method.java:515)        @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:793)        @ com.android.internal.os.zygoteinit.main(zygoteinit.java:609)        @ dalvik.system.nativestart.main(nativestart.java) caused java.io.notserializableexception: org.json.jsonobject$1        @ java.io.objectoutputstream.writenewobject(objectoutputstream.java:1366)        @ java.io.objectoutputstream.writeobjectinternal(objectoutputstream.java:1673)        @ java.io.objectoutputstream.writeobject(objectoutputstream.java:1519)        @ java.io.objectoutputstream.writeobject(objectoutputstream.java:1483)        @ java.util.hashmap.writeobject(hashmap.java:995)        @ java.lang.reflect.method.invokenative(method.java)        @ java.lang.reflect.method.invoke(method.java:515)        @ java.io.objectoutputstream.writehierarchy(objectoutputstream.java:1055)        @ java.io.objectoutputstream.writenewobject(objectoutputstream.java:1406)        @ java.io.objectoutputstream.writeobjectinternal(objectoutputstream.java:1673)        @ java.io.objectoutputstream.writeobject(objectoutputstream.java:1519)        @ java.io.objectoutputstream.writeobject(objectoutputstream.java:1483)        @ java.io.objectoutputstream.writefieldvalues(objectoutputstream.java:981)        @ java.io.objectoutputstream.defaultwriteobject(objectoutputstream.java:368)        @ java.io.objectoutputstream.writehierarchy(objectoutputstream.java:1076)        @ java.io.objectoutputstream.writenewobject(objectoutputstream.java:1406)        @ java.io.objectoutputstream.writeobjectinternal(objectoutputstream.java:1673)        @ java.io.objectoutputstream.writeobject(objectoutputstream.java:1519)        @ java.io.objectoutputstream.writeobject(objectoutputstream.java:1483)        @ java.io.objectoutputstream.writefieldvalues(objectoutputstream.java:981)        @ java.io.objectoutputstream.defaultwriteobject(objectoutputstream.java:368)        @ java.io.objectoutputstream.writehierarchy(objectoutputstream.java:1076)        @ java.io.objectoutputstream.writenewobject(objectoutputstream.java:1406)        @ java.io.objectoutputstream.writeobjectinternal(objectoutputstream.java:1673)        @ java.io.objectoutputstream.writeobject(objectoutputstream.java:1519)        @ java.io.objectoutputstream.writeobject(objectoutputstream.java:1483)        @ android.os.parcel.writeserializable(parcel.java:1318)        @ android.os.parcel.writevalue(parcel.java:1271)        @ android.os.parcel.writearraymapinternal(parcel.java:618)        @ android.os.bundle.writetoparcel(bundle.java:1692)        @ android.os.parcel.writebundle(parcel.java:643)        @ android.content.intent.writetoparcel(intent.java:7152)        @ android.app.activitymanagerproxy.startactivity(activitymanagernative.java:2663)        @ android.app.instrumentation.execstartactivity(instrumentation.java:1419)        @ android.app.activity.startactivityforresult(activity.java:3532)        @ android.app.activity.startactivityforresult(activity.java:3458)        @ android.support.v4.app.fragmentactivity.startactivityforresult(fragmentactivity.java:784)        @ android.app.activity.startactivity(activity.java:3780)        @ android.app.activity.startactivity(activity.java:3748)        @ com.social.fitspur.activities.activity_chat.start(activity_chat.java:100)        @ com.social.fitspur.activities.drawactivity_chatlist$3.onitemclick(drawactivity_chatlist.java:198)        @ android.widget.adapterview.performitemclick(adapterview.java:299)        @ android.widget.abslistview.performitemclick(abslistview.java:1162)        @ android.widget.abslistview$performclick.run(abslistview.java:2953)        @ android.widget.abslistview$3.run(abslistview.java:3708)        @ android.os.handler.handlecallback(handler.java:733)        @ android.os.handler.dispatchmessage(handler.java:95)        @ android.os.looper.loop(looper.java:149)        @ android.app.activitythread.main(activitythread.java:5257)        @ java.lang.reflect.method.invokenative(method.java)        @ java.lang.reflect.method.invoke(method.java:515)        @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:793)        @ com.android.internal.os.zygoteinit.main(zygoteinit.java:609)        @ dalvik.system.nativestart.main(nativestart.java) 

what understand is, encounters json in dialog not serializable , hence error.

note: working fine before april 15th, , have not made changes custom class too

i have tried upgrading sdk version v2.5 v2.5.2, no use.

quickblox added location_field returning jsonobject expecting string. adding lines while getting dialogs made trick.

for (qbdialog dialog : dialogs) {     qbdialogcustomdata customdata = dialog.getcustomdata();     usersids.addall(dialog.getoccupants());     if (customdata == null) {         continue;     }     hashmap<string, object> fields = customdata.getfields();     if (!fields.isempty()) {         fields.put("location_field", null);     } } 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -