收到错误消息:类"org.apache.http.message.BufferedHeader"未实现接口"org.apache.http.NameValuePair" [英] Getting Error : Class 'org.apache.http.message.BufferedHeader' does not implement interface 'org.apache.http.NameValuePair'

查看:410
本文介绍了收到错误消息:类"org.apache.http.message.BufferedHeader"未实现接口"org.apache.http.NameValuePair"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用运行正常.今天,我更改了一些内部内容并更新了我的应用程序.在版本Apk中,我收到此错误:

My app was working fine . Today i have change some internal things and update my app . In release Apk i am getting this error :

"org.apache.http.message.BufferedHeader"类未实现 界面"org.apache.http.NameValuePair"

Class 'org.apache.http.message.BufferedHeader' does not implement interface 'org.apache.http.NameValuePair'

我的应用在以前的更新中运行良好.我没有得到什么问题.我使用的是专业防护,还正确添加了规则.此错误的主要原因是什么.我已经检查了这个stackoverflow上的所有特定错误的所有答案.

My app was working fine in previous updates . I am not getting what is the problem . I am using pro-guard and also added rules properly. What is the main reason of this error. I have checked all answer of this particular error on stackoverflow.

还将此内容添加到build.gradle中:

Also Added this to build.gradle :

android {
        useLibrary 'org.apache.http.legacy'
    }

在清单中

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

Proguard:

-keep class org.apache.http.** { *; }
-keep class org.apache.** { *; }
-dontwarn org.apache.**
-dontwarn org.apache.http.**
-dontwarn org.apache.commons.**
-keep class com.google.api.** { *; }
-keepattributes Annotation

推荐答案

假定org.apache.http.message.BufferedHeader是接口org.apache.http.NameValuePair的合法实现,则您在类路径上有重复的类-特别注意两个不同的NameValuePair.

Assuming 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.

错误消息忽略了类加载器或home jar文件:认为它是:

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

'org.apache.http.message.BufferedHeader'类没有从jar X中实现接口'org.apache.http.NameValuePair',而从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.

如果这没有帮助:遍历运行时类路径,并识别引入相同类文件的jar.消除重复.

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

这篇关于收到错误消息:类"org.apache.http.message.BufferedHeader"未实现接口"org.apache.http.NameValuePair"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆