1、先将app的build.gradle中的minifyEnabled设置为ture,然后将proguard-android.txt修改为proguard-android-optimize.txt,因为proguard-android.txt 默认不优化,而proguard-android-optimize.txt是优化的
2、使用assumenosideeffects配置proguard-rules.pro
#去除log输出
-assumenosideeffects class android.util.Log{
public static *** v(...);
public static *** d(...);
public static *** i(...);
public static *** w(...);
public static *** e(...);
}