使用"dontwarn"在捍卫者 [英] Using "dontwarn" in proguard

查看:231
本文介绍了使用"dontwarn"在捍卫者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我成功使用了proguard,但是每当我添加外部库(那些属于广告的库)时,proguard都会失败,并显示找不到引用...等".我尝试了很多组合,例如libraryjars,injars ... etc,但是没有运气.

I use proguard successfully but whenever I add external library (those that belongs to advertising) proguard fails with "can't find reference ...etc". I tried many combination such as libraryjars, injars ...etc but no luck.

然后,我在外部文件上使用了"-dontwarn"选项,一切运行起来都很神奇.这不好吗?我的意思是在使用此属性处理外部jar时没有出现问题吗?

Then I used the " -dontwarn " option on the external file and things worked magically. Is this bad to do? I mean is there a problem I am not seeing with handling external jars using this attribute?

谢谢

推荐答案

对于有关缺少第三方类的警告,选项-ignorewarnings-dontwarn可能很好.如果代码已经在调试模式下工作,则意味着永远不会使用列出的缺少类.然后,您可以告诉ProGuard继续处理代码.

For warnings about missing third-party classes, the options -ignorewarnings or -dontwarn are probably fine. If the code already works in debug mode, it means that the listed missing classes are never used. You can then tell ProGuard to proceed processing the code anyway.

对于有关缺少Android运行时类,字段或方法的警告,您应该根据project.properties中指定的最新的Android运行时进行构建.您仍然可以在AndroidManifest.xml中定位较早的Android运行时.

For warnings about missing Android runtime classes, fields, or methods, you should build against a sufficiently recent Android runtime, specified in project.properties. You can still target an older Android runtime in AndroidManifest.xml.

请参阅ProGuard手册>故障排除:

See the ProGuard manual > Troubleshooting:

  • Warning: can't find referenced class
  • Warning: can't find referenced field/method '...' in library class ...

请注意,您不应在配置中添加-injars-libraryjars选项,因为标准的Ant/Eclipse/Gradle构建过程会自动为您指定这些选项.

Note that you should not add -injars or -libraryjars options to your configuration, since the standard Ant/Eclipse/Gradle build processes automatically specify these for you.

这篇关于使用"dontwarn"在捍卫者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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