Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant find class to parcel ! #395

Open
Dave181295 opened this issue Jan 16, 2021 · 1 comment
Open

Cant find class to parcel ! #395

Dave181295 opened this issue Jan 16, 2021 · 1 comment

Comments

@Dave181295
Copy link

Dave181295 commented Jan 16, 2021

I got. implementation 'org.parceler:parceler-api:1.1.12' annotationProcessor 'org.parceler:parceler:1.1.12'

this is my model

import org.parceler.Parcel
@Parcel
data  class ClientOrderDetailModel(
  var isScheduled: Boolean,
  var orderStatus: String,
  var userUUid: String,
  var restaurantUUID: String,
  var deliveryAddresseChoosen: String?,
  var timePicked: String?,
  var restaurantToken: String,
  var getCommmentsOfOrder: String?,
  var clientName: String,
  var clientPhone: String,
  var restaurantAddresse: String,
  var deliveryFeesAmount: Double?
)

this is the var

 val orderDetails = ClientOrderDetailModel(
                    isScheduled,
                    "pending",
                    clientID,
                     restaurantID!!,
                    deliveryAddresseChoosen,
                      timePicked,
                    restaurantToken!!,
                     getCommmentsOfOrder(),
                     clientName,
                     clientPhone,
                    restaurantAddresse!!,
                    deliveryFeesAmount
                )

but when I try to send it to next fragment
putParcelable("orderDetails", Parcels.wrap(orderDetails))

I Always got. org.parceler.ParcelerRuntimeException: Unable to find generated Parcelable class for com.olivier.oplivre.Models.ClientOrderDetailModel, verify that your class is configured properly and that the Parcelable class com.olivier.oplivre.Models.ClientOrderDetailModel$$Parcelable is generated by Parceler.

I got Proguard Enabled

# Parceler library -keep interface org.parceler.Parcel -keep @org.parceler.Parcel class * { *; } -keep class **$$Parcelable { *; }
Please im stuck hours! D:

Note: I' testing on DEBUG , not release

Android studio Version 4.1.1

@johncarl81
Copy link
Owner

Hmm, looks like a kotlin class.. you have to do special things for kotlin integration: https://stackoverflow.com/questions/33891814/use-of-parceler-with-kotlin-data-class-with-constructor-for-serialization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants