The type org.apache.http.HttpEntity cannot be resolved.错误的解决

本文介绍了当在Android 6.0 (SDK 23)环境下遇到类型org.apache.http.HttpEntity无法解析的问题时的解决方案。对于使用Android Studio的开发者,需要在build.gradle文件中的android块加入useLibrary 'org.apache.http.legacy'。而使用Eclipse的开发者,则需要从Android SDK的platforms/android-23/optional目录下将org.apache.http.legacy.jar复制到项目的libs文件夹。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


详见http://stackoverflow.com/questions/32434488/the-type-org-apache-http-header-cannot-be-resolved-it-is-indirectly-referenced


错误内容:The type org.apache.http.HttpEntity cannot be resolved. It is indirectly referenced from required .class files。。。。。


解决方法: 如上连接所述 


如果是studio的话,在gradle中增加  useLibrary ‘org.apache.http.legacy’

                如果是eclipse的话,在AndroidSDK/platforms/android-23/optional 找到对应的包 导入


3down voteaccepted

If you are compiling against Android 6.0 (SDK 23), you need to include org.apache.http.legacy library.

In Android Studio add

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

to build.gradle.

In Eclipse copy org.apache.http.legacy.jar from AndroidSDK/platforms/android-23/optionalto libs folder.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值