Proguard vs Annotations

前端 未结 5 578
忘了有多久
忘了有多久 2020-12-30 00:08

I have an app that uses ActiveAndroid, a database ORM library, that relies on annotations.

@Table(name=\"test\")
public class DatabaseItem extends ActiveReco         


        
5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-30 00:47

    In March 2013, Proguard version 4.9 was released, one of the fixes were:

    Fixed overly aggressive shrinking of class annotations. 
    

    So make sure that your Proguard version is up to date and then use Eric Lafortune's solution:

    -keepattributes *Annotation*
    

    You can also use this configuration to store all class members that has a specific annotation:

    -keepclassmembers class * {
        @fully.qualified.package.AnnotationType *;
    }
    

提交回复
热议问题