BadParcelableException:ClassNotFoundException when unmarshalling: android.support.v4.app.FragmentManagerState

前端 未结 2 1912
故里飘歌
故里飘歌 2021-02-02 16:17

I\'ve migrated to SDK Android 27.1.0 3 days ago, and there are some crashs like this one, I can\'t understand why. It appears (currently) on Android 8 and 6.

Ba         


        
相关标签:
2条回答
  • 2021-02-02 16:37

    @XJIOP said is correct i also have same issue on my production, but i was unable to find what the crash, i followed @XJIOP path and produce the bug,i resolved the bug by updating the compact version from

    appcompat 27.1.0 to 27.1.1

    since i am using proguard i also added the following line to my proguard

    add the following line to proguard if you are using proguard on your production build else ignore

    -keepnames class * implements android.os.Parcelable {
        public static final ** CREATOR;
    }
    

    After adding the pro guard line and updating the compact lib i was able to fix the issue and the bug hasent reported yet on my updated production build. hope this will help some others

    0 讨论(0)
  • 2021-02-02 16:59

    Same issues after update android library to 27.1.0

    My viewPager has 3 tabs, this crash occurs if I select first or last tab, then after loss activity and returning to viewPager chose another tab got this crash.

    Tested with 2 tabs has no crash.

    My fix is

    viewPager.setOffscreenPageLimit(2);
    

    and crash is gone

    EDIT

    Updating to 27.1.1 has resolved issue

    0 讨论(0)
提交回复
热议问题