2016-11-15 60 views
3

我正在使用Retrofit 2.1.0和OkHttp 3.4.2创建一个应用程序。ProtocolException与Proguard和OkHttp 3.0:

与minifyEnabled调试模式设置为false一切完美,但只要我改变minifyEnabled真我得到以下异常:

HTTP FAILED: java.net.ProtocolException: Too many follow-up requests: 21 

为OkHttp我Proguard的规则如下:

-keep class com.squareup.okhttp3.** { 
    *; 
} 
-dontwarn okhttp3.** 
-dontwarn okio.** 

我不明白为什么会抛出这个异常,我不明白为什么这个应用程序似乎正在提出21个后续请求。谁能帮我?

回答

-1

使用THI在乌尔proguard的角色:

-dontwarn com.squareup.okhttp.internal.huc.** 
-dontwarn com.squareup.okhttp.** 
-dontwarn com.squareup.okhttp3.** 
-dontwarn okio.** 
-dontwarn retrofit2.** 
-dontwarn org.codehaus.mojo.** 
-keep class retrofit2.** { *; } 
-keepattributes Signature 
-keepattributes Exceptions 
-keepattributes *Annotation*