使用ProGuard时需要注意的问题
2008-07-07 10:50
267 查看
proguard是什么,做什么用,不在这个地方介绍了,网上的资料很多很全。这里只提一下使用proguard需要注意的几个地方:
1、注意版本,如果不是项目需要,最好使用最新稳定版本,这样出错的机会小一些,学习曲线会明显缩短。
2、最好以源码的同编译版本的jvm来启动proguardgui.jar,不要直接用默认的jvm打开。
3、注意proguaardgui启动后默认加载的libraryjar中包含的rt.jar,它的版本和你使用到的jvm版本一致。
4、使用1.4的jvm打开proguard时,注意在optimization选项卡中,不要勾中keep enumerations选项,因为勾中这个选项会导致configration文件中出现java.lang.Enum,这个类
只有在1.5的环境下才有。报错信息如下:
[proguard] Note: the configuration refers to the unknown class 'java.lang.Enum'
[proguard] Note: there were 1 references to unknown classes.
[proguard] You should check your configuration for typos.
5、嵌入ant脚本时,通常会有这么一段
<target name="proguard" depends="init">
<taskdef resource="proguard/ant/task.properties" classpath="${lib.dir}/proguard/proguard.jar" />
<proguard configuration="${src.dir}/config.pro" />
</target>
task.properties在proguard.jar中,保留,config.pro是proguard的配置文件,最好使用proguardgui.jar先生成,然后再根据需求手动修改。
1、注意版本,如果不是项目需要,最好使用最新稳定版本,这样出错的机会小一些,学习曲线会明显缩短。
2、最好以源码的同编译版本的jvm来启动proguardgui.jar,不要直接用默认的jvm打开。
3、注意proguaardgui启动后默认加载的libraryjar中包含的rt.jar,它的版本和你使用到的jvm版本一致。
4、使用1.4的jvm打开proguard时,注意在optimization选项卡中,不要勾中keep enumerations选项,因为勾中这个选项会导致configration文件中出现java.lang.Enum,这个类
只有在1.5的环境下才有。报错信息如下:
[proguard] Note: the configuration refers to the unknown class 'java.lang.Enum'
[proguard] Note: there were 1 references to unknown classes.
[proguard] You should check your configuration for typos.
5、嵌入ant脚本时,通常会有这么一段
<target name="proguard" depends="init">
<taskdef resource="proguard/ant/task.properties" classpath="${lib.dir}/proguard/proguard.jar" />
<proguard configuration="${src.dir}/config.pro" />
</target>
task.properties在proguard.jar中,保留,config.pro是proguard的配置文件,最好使用proguardgui.jar先生成,然后再根据需求手动修改。
相关文章推荐
- 在使用GIT的时候文件名大小写需要注意的问题
- 在windows开发环境中,java代码中使用linux格式路径的方法需要注意的问题
- Mac下apache使用需要注意的几个问题
- 跨dll使用template/STL需要注意的问题
- 使用Kubernetes需要注意的一些问题(FAQ of k8s)
- 做移动应用使用地图API时需要注意的问题
- 使用proguard需要注意的几个地方
- [置顶] java Vector 在多线程使用中需要注意的问题
- php下使用iconv需要注意的问题
- 使用接插件需要注意的问题
- RealView MDK中使用内联函数时需要注意的问题
- linux下使用ThinkPHP需要注意大小写导致的问题
- 使用引用形参需要注意的问题
- 使用redis缓存数据需要注意的问题以及个人的一些思考和理解
- 在使用jfreechart中需要注意的问题
- 声明方法java实际开发中泛型使用需要注意的一些问题
- Xcode项目使用SVN需要注意的问题及设置
- 指针使用时需要注意的问题
- 使用jQuery Ajax功能时需要注意的一个问题(内存溢出)
- jeecg使用内嵌tomcat进行调试开发时需要注意的问题