Proguard causing RuntimeException (Unmarshalling unknown type code) in Parcelable class

As we found out in the comments, the exception was the result of ProGuard obfuscating Parcelable classes. The fix is to include this snippet in the ProGuard configuration file:

-keepclassmembers class * implements android.os.Parcelable {
    static ** CREATOR;
}

I guess the specific problem here was that ProGuard obfuscated the CREATOR member of PagerSlidingTabStrip, but since SavedState is a subclass of View.BaseSavedState, the superclass member was still available (this is why it didn’t throw a BadParcelableException), but that uses a different data structure and didn’t write the custom attributes into the Parcel output.

There is a recommended configuration for Android applications available in the ProGuard Manual, with detailed explanation about entries. For example, it includes that you should keep all class names used in the manifest or other XML files.

Leave a Comment