6

I'm working on updating an existing app to Marshmallow, and have just noticed there is this message in logcat when the app launches:

E/Parcel﹕ Class not found when unmarshalling: com.redacted.TheClass
    java.lang.ClassNotFoundException: com.redacted.TheClass.

It only occurs on Samsung devices, not LG nor Motorola. After more investigation I found the problem is also present in Lollipop and thus is present in a shipped version of the app.

However, despite it being an exception it appears to be having no detrimental effect - the app passed testing on Lollipop and is functioning as intended on L and M builds.

Therefore I'd like to find out if there are any consequences to not fixing this problem? Is the app functioning properly despite this exception chance, and if some sands get shifted elsewhere it might stop working?

Why not fix it ??!! You are all jumping up and down to ask. The reason is the app is not available on the app store, it is pre-installed into devices' roms and distributing a new .apk to device manufacturers would delay their Marshmallow roms building schedule. Therefore I do not want to create a new .apk unless there is a potential that the app could stop working, even though its been working fine with this issue.

In other words, I'll like to know in depth what causes this error message, but more particularly why it is that the app continues to function despite their being an OS level exception.

The full stack trace is:

11-24 09:03:43.065    3641-5600/? E/Parcel﹕ Class not found when unmarshalling: com.redacted.TheClass
    java.lang.ClassNotFoundException: com.redacted.TheClass
            at java.lang.Class.classForName(Native Method)
            at java.lang.Class.forName(Class.java:324)
            at android.os.Parcel.readParcelableCreator(Parcel.java:2383)
            at android.os.Parcel.readParcelable(Parcel.java:2337)
            at android.os.Parcel.readValue(Parcel.java:2243)
            at android.os.Parcel.readArrayMapInternal(Parcel.java:2592)
            at android.os.BaseBundle.unparcel(BaseBundle.java:221)
            at android.os.BaseBundle.getString(BaseBundle.java:920)
            at android.content.Intent.getStringExtra(Intent.java:6171)
            at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:2688)
            at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:2127)
            at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:6151)
            at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:5928)
            at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:170)
            at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3836)
            at android.os.Binder.execTransact(Binder.java:453)
     Caused by: java.lang.ClassNotFoundException: com.cequint.cityid.CityIdResponse
            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:469)
            at java.lang.Class.classForName(Native Method)
            at java.lang.Class.forName(Class.java:324)
            at android.os.Parcel.readParcelableCreator(Parcel.java:2383)
            at android.os.Parcel.readParcelable(Parcel.java:2337)
            at android.os.Parcel.readValue(Parcel.java:2243)
            at android.os.Parcel.readArrayMapInternal(Parcel.java:2592)
            at android.os.BaseBundle.unparcel(BaseBundle.java:221)
            at android.os.BaseBundle.getString(BaseBundle.java:920)
            at android.content.Intent.getStringExtra(Intent.java:6171)
            at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:2688)
            at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:2127)
            at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:6151)
            at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:5928)
            at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:170)
            at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3836)
            at android.os.Binder.execTransact(Binder.java:453)
     Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

The class inherits from Parcelable and is used to store several ints, booleans and Strings along with an activity (declared as Class).

When a state machine wants to switch to a new activity it creates an instance of this class and sets the activity then passes it to a method as a parameter. The method then uses the class to create an intent to launch the activity.

Gruntcakes
  • 37,738
  • 44
  • 184
  • 378

0 Answers0