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
Have you ever tried to add this to your grade file
like this
Observing that
org.apache.http.message.BufferedHeader
is a legitimate implementation of the interfaceorg.apache.http.NameValuePair
, you have duplicate classes on the classpath – look out specifically for two distinct occurrences ofNameValuePair
.The error message omits the classloader or home jar file: Think of it as:
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.