关于AsyncHttpClient的cz.msebera.android.httpclient.Header

简介:

android-async-http-1.4.9版本去除了httpclient的东西,所以会出现Header[] headers找不到的错误,这里分享下解决办法:

我们先看看官方:https://github.com/loopj/android-async-http/blob/master/library/build.gradle#L27

dependencies {

compile 'cz.msebera.android:httpclient:4.3.6'

}


我们也可以这样写,build就可以解决了。


如果网络不好,就下载jar包:http://mvnrepository.com/artifact/cz.msebera.android/httpclient/4.3.6


最后,如果你使用了1.4.9版本,出现连接不上服务器的问题,我给大家的建议是果断放弃1.4.9版本(不知道是不是bug),使用1.4.8版本,不要再浪费时间了。

相关文章
|
12天前
|
存储 安全 Java
javax.security.auth.login.LoginException: Receive timed out
`亲测可用,之前搜索了很多博客,啥样的都有,就是不介绍报错以及配置用处,根本不懂照抄那些配置是干啥的,稀里糊涂的按照博客搭完也跑不起来,因此记录这个。` `项目背景`:公司项目当前采用http协议+shiro+mysql的登录认证方式,而现在想支持ldap协议认证登录然后能够访问自己公司的项目网站。 `举例说明`:假设我们公司有自己的门户网站,现在我们收购了一家公司,他们数据库采用ldap存储用户数据,那么为了他们账户能登陆我们公司项目所以需要集成,而不是再把他们的账户重新在mysql再创建一遍,万一人家有1W个账户呢,不累死了且也不现实啊。
41 10
|
12天前
|
存储 Java 数据库
javax.security.auth.login.LoginException: Message stream modified (41)
`亲测可用,之前搜索了很多博客,啥样的都有,就是不介绍报错以及配置用处,根本不懂照抄那些配置是干啥的,稀里糊涂的按照博客搭完也跑不起来,因此记录这个。` `项目背景`:公司项目当前采用http协议+shiro+mysql的登录认证方式,而现在想支持ldap协议认证登录然后能够访问自己公司的项目网站。 `举例说明`:假设我们公司有自己的门户网站,现在我们收购了一家公司,他们数据库采用ldap存储用户数据,那么为了他们账户能登陆我们公司项目所以需要集成,而不是再把他们的账户重新在mysql再创建一遍,万一人家有1W个账户呢,不累死了且也不现实啊。
33 7
|
4月前
response.addheader详解
response.addheader详解
ODataListBinding.filter 方法里 FilterType.Application 和 FilterType.Control 的区别
ODataListBinding.filter 方法里 FilterType.Application 和 FilterType.Control 的区别
Plugin with id 'com.android.application' not found
Plugin with id 'com.android.application' not found
138 0
|
XML Java 数据库连接
HTTP Status 500 - Request processing failed; nested exception is org.apache.ibatis.binding.BindingEx
HTTP Status 500 - Request processing failed; nested exception is org.apache.ibatis.binding.BindingEx
1225 0
HTTP Status 500 - Request processing failed; nested exception is org.apache.ibatis.binding.BindingEx
|
Apache
解决办法:Cannot find the class file for org.apache.http.client.ClientProtocolException
解决办法:Cannot find the class file for org.apache.http.client.ClientProtocolException
355 0
|
Java 应用服务中间件 API
|
Java Apache Android开发