本文共 419 字,大约阅读时间需要 1 分钟。
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版本,不要再浪费时间了。
转载地址:http://zdbbm.baihongyu.com/