Android中的异步Http服务器

2024-01-09

我正在 Android 中实现一个异步 HTTP 服务器。我正在使用链接中的代码http://hc.apache.org/httpcomponents-core-ga/examples.html http://hc.apache.org/httpcomponents-core-ga/examples.html(异步 HTTP 服务器)..在编译它时,我收到以下错误并且应用程序崩溃:

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

在行中

HttpParams params = new SyncBasicHttpParams();

请告知原因以及如何解决?

I am using the jars from httpcomponents-core-4.3-alpha1. enter image description here

谢谢你!


此线程上可能有一个答案的开头:Android 1.6 中捆绑了哪个版本的 Apache HTTP 客户端? https://stackoverflow.com/questions/2618573/what-version-of-apache-http-client-is-bundled-in-android-1-6

实际上,您收到的错误表明您使用的 SyncBasicHttpParams 类与 android 中附带的 HttpParams 类不兼容。您应该尝试将 apache 库降级到 4.0.X,如线程中所示。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Android中的异步Http服务器 的相关文章

随机推荐