json - FlexJson ClassNotFound Exception on Android 4.4.4 -
i´ve got multidex project android devices. use flexjson. i´ve tested flexjson 3.3 , 2.x.
it works android 5.x crashes in android 4.4.4.
it looks dex support library not working propperly older android versions cannot tell.
here´s stacktrace:
06-29 03:50:44.763 11884-11884/com.pigdroid.gameboard e/androidruntime﹕ fatal exception: main process: com.pigdroid.gameboard, pid: 11884 flexjson.jsonexception: [ layers.values ]: not load com.pigdroid.game.board.tile.model.inttilelayer @ flexjson.objectbinder.findclassinmap(objectbinder.java:250) @ flexjson.objectbinder.findclassname(objectbinder.java:213) @ flexjson.objectbinder.bind(objectbinder.java:92) @ flexjson.objectbinder.bindintocollection(objectbinder.java:110) @ flexjson.factories.listobjectfactory.instantiate(listobjectfactory.java:13) @ flexjson.objectbinder.bind(objectbinder.java:95) @ flexjson.objectbinder.bindintoobject(objectbinder.java:149) @ flexjson.factories.existingobjectfactory.instantiate(existingobjectfactory.java:25) @ flexjson.objectbinder.bind(objectbinder.java:95) @ flexjson.objectbinder.bind(objectbinder.java:74) @ flexjson.jsondeserializer.deserialize(jsondeserializer.java:241) @ flexjson.jsondeserializer.deserializeinto(jsondeserializer.java:301) @ com.pigdroid.game.model.memento.undoableobject.from(undoableobject.java:35) @ com.pigdroid.game.controller.gamecontroller.loadmodelfromserialized(gamecontroller.java:108) @ com.pigdroid.gameboard.view.detail.game.tile.tileboardgamefragmentcontroller.setgame(tileboardgamefragmentcontroller.java:692) @ com.pigdroid.gameboard.view.detail.game.gamedetailfragment.onkickoff(gamedetailfragment.java:168) @ com.pigdroid.gameboard.view.servicefragment.kickoffif(servicefragment.java:71) @ com.pigdroid.gameboard.view.detail.game.gamedetailfragment.kickoffif(gamedetailfragment.java:159) @ com.pigdroid.gameboard.view.servicefragment$3.bound(servicefragment.java:52) @ com.pigdroid.gameboard.view.servicefragment$3.bound(servicefragment.java:48) @ com.pigdroid.android.hateaidl.hateaidlconnection$3.onserviceconnected(hateaidlconnection.java:118) @ android.app.loadedapk$servicedispatcher.doconnected(loadedapk.java:1101) @ android.app.loadedapk$servicedispatcher$runconnection.run(loadedapk.java:1118) @ android.os.handler.handlecallback(handler.java:733) @ android.os.handler.dispatchmessage(handler.java:95) @ android.os.looper.loop(looper.java:136) @ android.app.activitythread.main(activitythread.java:5001) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:515) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:785) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:601) @ dalvik.system.nativestart.main(native method) caused by: java.lang.classnotfoundexception: didn't find class "com.pigdroid.game.board.tile.model.inttilelayer" on path: dexpathlist[[directory "."],nativelibrarydirectories=[/system/lib]] @ dalvik.system.basedexclassloader.findclass(basedexclassloader.java:56) @ java.lang.classloader.loadclass(classloader.java:497) @ java.lang.classloader.loadclass(classloader.java:457) @ android.app.loadedapk$warningcontextclassloader.loadclass(loadedapk.java:430) @ flexjson.objectbinder.findclassinmap(objectbinder.java:243) at flexjson.objectbinder.findclassname(objectbinder.java:213) at flexjson.objectbinder.bind(objectbinder.java:92) at flexjson.objectbinder.bindintocollection(objectbinder.java:110) at flexjson.factories.listobjectfactory.instantiate(listobjectfactory.java:13) at flexjson.objectbinder.bind(objectbinder.java:95) at flexjson.objectbinder.bindintoobject(objectbinder.java:149) at flexjson.factories.existingobjectfactory.instantiate(existingobjectfactory.java:25) at flexjson.objectbinder.bind(objectbinder.java:95) at flexjson.objectbinder.bind(objectbinder.java:74) at flexjson.jsondeserializer.deserialize(jsondeserializer.java:241) at flexjson.jsondeserializer.deserializeinto(jsondeserializer.java:301) at com.pigdroid.game.model.memento.undoableobject.from(undoableobject.java:35) at com.pigdroid.game.controller.gamecontroller.loadmodelfromserialized(gamecontroller.java:108) at com.pigdroid.gameboard.view.detail.game.tile.tileboardgamefragmentcontroller.setgame(tileboardgamefragmentcontroller.java:692) at com.pigdroid.gameboard.view.detail.game.gamedetailfragment.onkickoff(gamedetailfragment.java:168) at com.pigdroid.gameboard.view.servicefragment.kickoffif(servicefragment.java:71) at com.pigdroid.gameboard.view.detail.game.gamedetailfragment.kickoffif(gamedetailfragment.java:159) at com.pigdroid.gameboard.view.servicefragment$3.bound(servicefragment.java:52) at com.pigdroid.gameboard.view.servicefragment$3.bound(servicefragment.java:48) at com.pigdroid.android.hateaidl.hateaidlconnection$3.onserviceconnected(hateaidlconnection.java:118) at android.app.loadedapk$servicedispatcher.doconnected(loadedapk.java:1101) at android.app.loadedapk$servicedispatcher$runconnection.run(loadedapk.java:1118) at android.os.handler.handlecallback(handler.java:733) at android.os.handler.dispatchmessage(handler.java:95) at android.os.looper.loop(looper.java:136) at android.app.activitythread.main(activitythread.java:5001) at java.lang.reflect.method.invokenative(native method) at java.lang.reflect.method.invoke(method.java:515) at com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:785) at com.android.internal.os.zygoteinit.main(zygoteinit.java:601) at dalvik.system.nativestart.main(native method)
edit: i´ve filled issue android dev team , they´ve noted bug feature, when works on latter versions. if found anoying, please try vote reopening: https://code.google.com/p/android/issues/detail?id=178607
i´ve taken method failing objectbinder.findclassinmap
class loader this: classloader classloader = thread.currentthread().getcontextclassloader();
i suppose there´s kind of bad install of multi dex class loader because i´ve set loader myself before deserialization occurs , fixed problem.
the line fixin' error i´ve added before loading game model goes this:
thread.currentthread().setcontextclassloader(owner.getactivity().getbasecontext().getclassloader());
Comments
Post a Comment