Proguard 与注解 [英] Proguard vs Annotations
本文介绍了Proguard 与注解的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个应用程序使用 ActiveAndroid,它是一个依赖于注释的数据库 ORM 库.
I have an app that uses ActiveAndroid, a database ORM library, that relies on annotations.
@Table(name="test")
public class DatabaseItem extends ActiveRecordBase<DatabaseItem> {
public DatabaseItem(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
@Column(name="counter")
public int counter;
}
我如何让 Proguard 与此配合得很好?目前,我在使用 Proguard 时遇到有关 ActiveAndroid 找不到列名的错误.我猜它以某种方式破坏了注释.
How do I get Proguard working nicely with this? Currently, I get errors about not finding a column name by ActiveAndroid when using Proguard. I guess it somehow mangles the annotation.
我的相关 Proguard 配置:
My relevant Proguard configuration:
#ActiveAndroid
-keep public class com.activeandroid.**
-keep public class * extends com.activeandroid.ActiveRecordBase
-keepattributes Column
-keepattributes Table
推荐答案
Column
和 Table
不是现有的 java 类文件属性.您至少必须指定
Column
and Table
aren't existing java class file attributes. You'll at least have to specify
-keepattributes *Annotation*
参照ProGuard 手册.
这篇关于Proguard 与注解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文