parceler icon indicating copy to clipboard operation
parceler copied to clipboard

Unable to find generated Parcelable class for Room database.

Open mmlaif opened this issue 6 years ago • 6 comments

This library start to crash my app on some users devices, I can't replicate the error to solve it or understand it!

Firebase shows:

Fatal Exception: org.a.d
Unable to find generated Parcelable class for com.mzdhr.taskboxes.database.b.a, verify that your class is configured properly and that the Parcelable class com.mzdhr.taskboxes.database.b.a$$Parcelable is generated by Parceler.
org.parceler.Parcels$ParcelCodeRepository.get (Parcels.java:86)
org.parceler.Parcels.wrap (Parcels.java:6)
org.parceler.Parcels.wrap (Parcels.java:6)
org.parceler.Parcels.wrap (Parcels.java:8)
org.parceler.Parcels.wrap (Parcels.java:8)
com.mzdhr.taskboxes.adapter.ListTaskAdapter$ListTaskViewHolder.bindTask (ListTaskAdapter.java:30)
com.mzdhr.taskboxes.adapter.ListTaskAdapter$ListTaskViewHolder.lambda$k6isy2_9Solp7Y5dt9bbw6BfEvQ (ListTaskAdapter.java)
com.mzdhr.taskboxes.adapter.-$$Lambda$ListTaskAdapter$ListTaskViewHolder$k6isy2_9Solp7Y5dt9bbw6BfEvQ.onClick (-.java:4)
android.view.View.performClick (View.java:6600)
android.view.View.performClickInternal (View.java:6577)
android.view.View.access$3100 (View.java:781)
android.view.View$PerformClick.run (View.java:25912)
android.os.Handler.handleCallback (Handler.java:873)
android.os.Handler.dispatchMessage (Handler.java:99)
android.os.Looper.loop (Looper.java:193)
android.app.ActivityThread.main (ActivityThread.java:6923)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:870)

mmlaif avatar Sep 26 '19 18:09 mmlaif

Do you have some example code where the issue is happening?

johncarl81 avatar Sep 27 '19 19:09 johncarl81

Code:

                /** Passing Data to More Info Dialog via a Bundle Args **/
                // Passing data to DetailsFragment via a Bundle
                android.app.FragmentManager manager = ((Activity) mContext).getFragmentManager();
                Bundle args = new Bundle();
                Parcelable wrappedTaskEntity = Parcels.wrap(taskEntity);
                args.putParcelable(Constant.TASK_PARCELABLE_KEY, wrappedTaskEntity);
                mMoreInfoDialog.setArguments(args);
                mMoreInfoDialog.show(manager, "TaskMoreInfoFragment");

This happen (inside a adapter/viewholder classes) when I try to Parcels lib to wrap my objects to send them as args to a dialog. It works fine, but in some phones the library can parcel my objects and app crash.

com.mzdhr.taskboxes.database.b.a

b.a is the entitiy/TAskEntitiy.java class that used with Room database. I think using proguard shriks resources names.

Users effective: 11

Phones effective: moto g(6) play Galaxy S8+ Galaxy A6+ Moto G (3rd Gen) HUAWEI Mate 9 lite Lenovo PHAB2 Plus P20

OS version: 7, 6, 9, 8

App link: https://play.google.com/store/apps/details?id=com.mzdhr.taskboxes

mmlaif avatar Sep 27 '19 20:09 mmlaif

Are you splitting your app up into multiple different aars?

johncarl81 avatar Sep 27 '19 20:09 johncarl81

multiple different aars? activities, fragments, dialgos if you mean that then yes.

mmlaif avatar Sep 27 '19 20:09 mmlaif

No, I mean android archives... We've seen issues with using Parcelables and classloaders between libraries. Doesn't sound like this is the case for you, however.

What version of Parceler are you using?

johncarl81 avatar Sep 27 '19 21:09 johncarl81

Oh. It was version 1.1.11. I upgrade to 1.1.12 trying to replicated the error but couldn't. I think i need other phone devices to do it.

mmlaif avatar Sep 27 '19 21:09 mmlaif