5
java.lang.IncompatibleClassChangeError: Class 
'org.apache.http.message.BufferedHeader' does not implement 
interface 'org.apache.http.NameValuePair' in call to 
'java.lang.String org.apache.http.NameValuePair.getValue()' 
(declaration of 'com.google.firebase.perf.network.NetworkRequestMetricBuilderUtil' 
appears in /data/app/~~mWC7wl-mdiulxrPqJH3MXg==/com.vendsy.tray-5- 
xmP-bIr7MJZJOfz9feYA==/base.apk) at com.google.firebase.perf.network.NetworkRequestMetricBuilderUtil.getApacheHttpResponseContentType(NetworkRequestMetricBuilderUtil.java:62) 
at com.google.firebase.perf.network.FirebasePerfHttpClient.execute(FirebasePerfHttpClient.java:200) 
at com.google.firebase.perf.network.FirebasePerfHttpClient.execute(FirebasePerfHttpClient.java:48)

i tried adding proguard rules but it didn't worked

-keep class org.apache.http.HttpResponse { *; }
-dontwarn org.apache.http.**
-keep class com.google.firebase.perf.network.** {*;}
-dontwarn com.google.firebase.perf.network.**
Upendra Shah
  • 2,218
  • 17
  • 27
avez raj
  • 2,055
  • 2
  • 22
  • 37

4 Answers4

0

The problem actually lies in your Model.class If you're parsing the response in a model, then you have to specify the proguard rules for that.

Check if you have such behavior, and if you have, simply provide the proguard rules for that class or classes and you'll be fine.

Dev4Life
  • 2,328
  • 8
  • 22
0

Add below rules-

-keep class org.apache.http.message.BufferedHeader {
  getValue();
}

or as below-

-keep class com.google.firebase.perf.network.** { *; }
-keep class org.apache.http.** { *; }
-keep interface org.apache.http.** { *; }
Vinay
  • 732
  • 5
  • 8
0

I would recommend whitelisting all DTO classes in proguard-rules.pro file.

Try to add the suffix DTO to each data class you are mapping API response to and add following lines to proguard-rules.pro file

-keep class *.**DTO
-keepclasseswithmembers class *.**DTO {
 *;
}
Dmytro Batyuk
  • 957
  • 8
  • 15
0

Add @Keep in your model classes. e.g:

Kotlin

@Keep
data class user(
    val id: Int,
    val name: String
)

JAVA

@Keep
class user {
    int id;
    String name;

    // Your getter/setters

}
Sohaib Ahmed
  • 1,990
  • 1
  • 5
  • 23