Expanding on @Ivan's answer: You can configure ProGuard to keep certain classes it would otherwise remove (for example, because they are only referenced by reflection) by adding lines like this to proguard-project.txt: