1.基本的的使用能够很容易百度到,android
可是当你使用了android-support-v4或者android-support-v7或者android-support-v11包以后,你发现导出的时候,api
警告至关得多,这个时候,就算百度,Google都不太好使了,由于他们都是回答了一部分,没有很好的解决你的问题:ide
其实要解决你的问题的方法就在你的android-sdk路径的proguard中的文档中:google
特别是Examples示例中:日志
示例中有专门针对android的说明:code
如下是第一点:ci
If you're using additional Google APIs, you'll have to specify those as well, for instance:开发
若是你使用了Google API,你还须要添加以下声明 rem
-libraryjars /usr/local/android-sdk/add-ons/google_apis-7_r01/libs/maps.jar
If you're using the Android Compatibility library, you should add the following line, to let ProGuard know it's ok that the library references some classes that are not available in all versions of the API:文档
若是你使用了android-support包,你须要使用如下声明设置,让ProGuard知道库中的一些类并非在全部版本的API中可用:
-dontwarn android.support.**
若是你还有其它问题,那仍是参见proguard文档吧..
2.使用ProGuard删除日志输出语句,
Thanks to:statckoverflow
在开发android的时候,常常要使用Log.d()语句,可是发布的时候,若是一行一行的注释仍是有点麻烦的.
这个时候能够使用以下的指令让proguard帮助咱们删除他:
-assumenosideeffects class android.util.Log{ public static *** d(...); public static *** i(...); }