Proguard的VS注解 [英] Proguard vs Annotations

查看:175
本文介绍了Proguard的VS注解的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用ActiveAndroid,数据库ORM库,依赖注释。一个应用程序

  @Table(名称=测试)
公共类DatabaseItem扩展ActiveRecordBase< D​​atabaseItem> {    公共DatabaseItem(上下文的背景下){
        超级(上下文);
        // TODO自动生成构造函数存根
    }    @Column(NAME =反)
    公众诠释柜台;}

我如何得到Proguard的这个工作很好?目前,我得到使用ProGuard时ActiveAndroid没有找到列名错误。我想这在某种程度上轧液注释。

我的相关Proguard的配置:

  #ActiveAndroid
-keep公共类com.activeandroid。**
-keep公共类*扩展com.activeandroid.ActiveRecordBase
-keepattributes列
-keepattributes表


解决方案

不存在Java类文件属性。你至少要指定

  -keepattributes *注释*

(CFR)。 ProGuard的手动。

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;

}

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.

My relevant Proguard configuration:

#ActiveAndroid
-keep public class com.activeandroid.**
-keep public class * extends com.activeandroid.ActiveRecordBase
-keepattributes Column
-keepattributes Table

解决方案

Column and Table aren't existing java class file attributes. You'll at least have to specify

-keepattributes *Annotation*

Cfr. the ProGuard manual.

这篇关于Proguard的VS注解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆