【发布时间】:2018-03-08 19:13:43
【问题描述】:
编辑
清理和重建后,不会生成类
我在尝试使用 Parcels.wrap() 时遇到此错误
Unable to find generated Parcelable class for xyz.xyz.models.reclamation.Reclamation, verify that your class is configured properly and that the Parcelable class xyz.xyz.models.reclamation.Reclamation$$Parcelable is generated by Parceler.
但是Reclamation$$Parcelable 类已创建,我可以看到它的内容。
那是我的毕业典礼:
compile 'org.parceler:parceler-api:1.1.6'
annotationProcessor 'org.parceler:parceler:1.1.6'
尝试将 annotationProcessor 更改为 apt 会导致构建错误。
那是回收类
@Parcel
public class Reclamation {
public Reclamation() {
}
private int reclamationProductID;
private Integer preference;
private String takingDate1;
private String takingDate2;
private int takingAddressID;
private String takingAddressStreet;
private String takingAddressCity;
private String takingAddressZipCode;
private int type;
private String takingAddressCompany;
// + getters setters
}
这就是它崩溃的地方
ServiceStepFour_.builder().arg(Constants.ARG_RECLAMATION, Parcels.wrap(reclamation)).build();
我将它与 Android Annotations 结合使用。
有人知道为什么会这样吗?
【问题讨论】:
-
你有没有机会在你的构建中配置了 proguard?