Asynchronous Http server in android

▼魔方 西西 提交于 2020-01-04 13:15:34

问题


I m implementing an asynchronous HTTP server in Android. I am using the code from link http://hc.apache.org/httpcomponents-core-ga/examples.html (Asynchronous HTTP server).. While compiling it I am getting the following error and application crashes:

java.lang.IncompatibleClassChangeError:org.apache.http.params.SyncBasicHttpParams 

in the line

HttpParams params = new SyncBasicHttpParams();

Please let me know the cause and how to resolve it?

I am using the jars from httpcomponents-core-4.3-alpha1.

Thank you!


回答1:


There might be a beginning of answer on this thread : What version of Apache HTTP Client is bundled in Android 1.6?

Indeed the error you get states that the SyncBasicHttpParams class you use is not compatible with the HttpParams class shipped in android. You should try to downgrade your apache libs to 4.0.X as indicated in the thread.



来源:https://stackoverflow.com/questions/13910895/asynchronous-http-server-in-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!