Using “dontwarn” in proguard

不羁岁月 提交于 2019-12-01 02:07:49

问题


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.

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?

Thank you


回答1:


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.

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.

See the ProGuard manual > Troubleshooting:

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

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.



来源:https://stackoverflow.com/questions/18693914/using-dontwarn-in-proguard

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!