skip to Main Content

Firstly I have used all of the solution in stackoverflow but in release apk i am getting this error. Can anyone tell me how to solve the issue? I am facing this problem while getting time from google.

dateStr = response.getFirstHeader("Date").getValue();

I also added Volly Lib And this on manifest. The method is working in my other apps , But i don’t know why it is happening in a particular app.

<uses-library
            android:name="org.apache.http.legacy"
            android:required="false" />

Exception:

Caused by: 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 'package.MainActivity$GoogleTime' appears in /data/app/packagename-666QBWSxEt_A-vBNzTMWfA==/base.apk)

2

Answers


  1. Have you ever tried to add this to your grade file

    useLibrary 'org.apache.http.legacy'
    

    like this

    android {
    .
    .
    useLibrary 'org.apache.http.legacy'
    }
    
    dependicies {
    .
    .
    }
    
    Login or Signup to reply.
  2. Observing that org.apache.http.message.BufferedHeader is a legitimate implementation of the interface org.apache.http.NameValuePair, you have duplicate classes on the classpath – look out specifically for two distinct occurrences of NameValuePair.

    The error message omits the classloader or home jar file: Think of it as:

    Class ‘org.apache.http.message.BufferedHeader’ does not implement interface ‘org.apache.http.NameValuePair’ from jar X, while it implements an interface with the same name from jar Y.

    Identify what you did during the time that you describe as “change some internal things and update my app”, it might point you to it. If you didn’t introduce another dependency, the class loading order might have changed.

    If that doesn’t help: Look through the runtime classpath and identify the jars that introduce the same class files. Eliminate duplications.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search