Clone wiki

cupboard / ProGuard

Keeping field names when using ProGuard

When using Cupboard (or any other ORM for that matter) in combination with ProGuard, it's important to make sure that ProGuard does not rename or remove entity fields. If fields are removed by ProGuard, created tables will be incomplete queries might fail as a result. When fields are renamed, queries will also fail and duplicate column name errors might occur.

To make sure ProGuard will leave your model classes alone, use the following configuration, assuming your models are in the package

-keep class** {*;}

If you have entities in other packages you'll need to add a line to your ProGuard configuration for each package or for every individual entity.