Open defaultbr opened 8 years ago
Strange exception - haven't met this one in all my time with Android! I am not able to reproduce this on my end. Can you provide me with the API version that produces this exception? Also, are you testing on a physical device or emulator/genymotion?
Just at API 23 and LG G4, but at this moment im using a workaround,
changed this method and added try/catch below
@Override
protected void onRestoreInstanceState(Parcelable savedState) {
SublimeNavigationView.SavedState state
= (SublimeNavigationView.SavedState) savedState;
super.onRestoreInstanceState(state.getSuperState());
Bundle menuState = state.getMenuState();
try {
if (menuState != null && menuState.containsKey(SS_MENU)) {
mMenu = menuState.getParcelable(SS_MENU);
}
} catch (Exception e) {
e.printStackTrace();
}
if (mMenu != null) {
mMenu.setCallback(new SublimeMenu.Callback() {
public boolean onMenuItemSelected(SublimeMenu menu, SublimeBaseMenuItem item,
OnNavigationMenuEventListener.Event event) {
return SublimeNavigationView.this.mEventListener != null
&& SublimeNavigationView.this
.mEventListener.onNavigationMenuEvent(event, item);
}
});
mMenu.setMenuPresenter(mPresenter);
}
}
I have made some changes and posted them to the dev
branch. Can you check if the modified onRestoreInstanceState(Parcelable)
method helps solve this issue?
no, still has the same error =/, maybe its in the launchMode, maybe it try to recover the first activity that has the navdrawer from the stack and the error happens
Facing the same Issue. Target API 23
E/Parcel: Class not found when unmarshalling: com.appeaser.sublimenavigationviewlibrary.SublimeMenu java.lang.ClassNotFoundException: com.appeaser.sublimenavigationviewlibrary.SublimeMenu at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:309) at java.lang.Class.forName(Class.java:273) at android.os.Parcel.readParcelableCreator(Parcel.java:2281) at android.os.Parcel.readParcelable(Parcel.java:2245) at android.os.Parcel.readValue(Parcel.java:2152) at android.os.Parcel.readArrayMapInternal(Parcel.java:2485) at android.os.BaseBundle.unparcel(BaseBundle.java:221) at android.os.BaseBundle.containsKey(BaseBundle.java:269) at com.appeaser.sublimenavigationviewlibrary.SublimeNavigationView.onRestoreInstanceState(SublimeNavigationView.java:479) at android.view.View.dispatchRestoreInstanceState(View.java:13756) at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2888) at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894) at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894) at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894) at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894) at android.view.View.restoreHierarchyState(View.java:13734) at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:2060) at android.app.Activity.onRestoreInstanceState(Activity.java:1023) at android.app.Activity.performRestoreInstanceState(Activity.java:978) at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1162) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2331) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2420) at android.app.ActivityThread.access$900(ActivityThread.java:154) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5292) 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:904) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.appeaser.sublimenavigationviewlibrary.SublimeMenu" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib64, /system/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:469) at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:309) at java.lang.Class.forName(Class.java:273) at android.os.Parcel.readParcelableCreator(Parcel.java:2281) at android.os.Parcel.readParcelable(Parcel.java:2245) at android.os.Parcel.readValue(Parcel.java:2152) at android.os.Parcel.readArrayMapInternal(Parcel.java:2485) at android.os.BaseBundle.unparcel(BaseBundle.java:221) at android.os.BaseBundle.containsKey(BaseBundle.java:269) at com.appeaser.sublimenavigationviewlibrary.SublimeNavigationView.onRestoreInstanceState(SublimeNavigationView.java:479) at android.view.View.dispatchRestoreInstanceState(View.java:13756) at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2888) at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894) at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894) at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894) at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894) at android.view.View.restoreHierarchyState(View.java:13734) at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:2060) at android.app.Activity.onRestoreInstanceState(Activity.java:1023) at android.app.Activity.performRestoreInstanceState(Activity.java:978) at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1162) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2331) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2420) at android.app.ActivityThread.access$900(ActivityThread.java:154) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5292) 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:904) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699) Suppressed: java.lang.ClassNotFoundException: com.appeaser.sublimenavigationviewlibrary.SublimeMenu at java.lang.Class.classForName(Native Method) at java.lang.BootClassLoader.findClass(ClassLoader.java:781) at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) at java.lang.ClassLoader.loadClass(ClassLoader.java:504) ... 33 more Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available 04-05 01:04:27.730 30608-30608/? D/AndroidRuntime: Shutting down VM
I think this bug was fixed in dev branch. I didn't get this exception since fix. Add library to your buiild.gradle
file like this:
compile group: "com.github.vikramkakkar", name: "SublimeNavigationView", version: "dev-SNAPSHOT", changing: true
I've got same issue on prod application. Are there any plans on fixing the bug?
Activity A (has the drawer) call and start Activity B(doesnt has drawer) go to home pressing the home button, close activity using android task switcher, click in the Icon to open the Application again:
i cant simulate the Android GC after some time, but i think the result will be the same, how can i avoid it? since it commom to user stay in my second activity (B) and than reopen the application(clicking in the application icon)