我正在使用proguard进行安全签名的apk,当我使用 proguard-android.txt 文件时它很好。但是当我使用 proguard-android-optimize.txt 进行logcat隐藏时,它会在生成签名的apk时给出错误
Unexpected error while performing partial evaluation: Class = [org/apache/http/impl/conn/BasicClientConnectionManager] Method = [getConnection$219f236b(Lorg/apache/http/conn/routing/HttpRoute;)Lorg/apache/http/conn/ManagedClientConnection;] Exception = [java.lang.IllegalArgumentException] (Can't find common super class of [org/apache/http/impl/conn/HttpPoolEntry] (with
1个已知超类)和[org / apache / http / conn / routing / HttpRoute] (有2个已知的超类))
我的proguard-rules.pro文件是
#Removing log cat
-assumenosideeffects class android.util.Log {
public static boolean isLoggable(java.lang.String, int);
public static int v(...);
public static int i(...);
public static int w(...);
public static int d(...);
public static int e(...);
}
#Httplibrary
-dontwarn org.apache.**
-dontwarn org.apache.http.**
-dontnote android.net.http.*
-dontnote org.apache.commons.codec.**
-dontnote org.apache.http.**
-keep public class org.apache.http.**{
public protected *;
}
-keep interface org.apache.http.**
# OrmLite uses reflection
-keepattributes Signature
-keep class com.j256.**
-keepclassmembers class com.j256.** { *; }
-keep enum com.j256.**
-keepclassmembers enum com.j256.** { *; }
-keep interface com.j256.**
-keepclassmembers interface com.j256.** { *; }
-keepclassmembers class com.j256.** {
public *;
}
-keep public class com.j256.ormlite.**{
public protected *;
}
-keep public class * extends com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper
-keep public class com.nacheepa.nacheepa.database.DBOpenHelper
-keepattributes *Annotation*
#Other app
-keep public class com.android.volley.**{
public protected *;
}
-keep public class android.support.v7.**{
public protected *;
}
-keep public class android.support.design.**{
public protected *;
}
-keep public class android.support.v4.**{
public protected *;
}
-keep public class com.nacheepa.nacheepa.**{
public protected *;
}
-keep public class com.google.i18n.phonenumbers.**{
public protected *;
}
-keep public class uk.co.senab.photoview.**{
public protected *;
}
-keep public class de.hdodenhof.circleimageview.**{
public protected *;
}
-keep public class com.sithagi.countrycodepicker.**{
public protected *;
}
-keep public class com.nostra13.universalimageloader.**{
public protected *;
}
指导我为proguard编写有效规则,因为我是第一次使用proguard 谢谢!