Problem with old HttpClient in Android

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with old HttpClient in Android

bhiefer
Hi all, after updating cling to 2.0 alpha2 (I skipped alpah1) I am facing a problem with old version of HttpClient. I get following exception:

02-27 15:34:17.992: E/AndroidRuntime(22307): java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.<init>
02-27 15:34:17.992: E/AndroidRuntime(22307): at org.fourthline.cling.transport.impl.apache.StreamClientImpl.<init>(StreamClientImpl.java:93)
02-27 15:34:17.992: E/AndroidRuntime(22307): at com.ventismedia.android.mediamonkeybeta.upnp.UpnpBrowseService$2.createStreamClient(UpnpBrowseService.java:110)
02-27 15:34:17.992: E/AndroidRuntime(22307): at org.fourthline.cling.transport.RouterImpl.enable(RouterImpl.java:142)
02-27 15:34:17.992: E/AndroidRuntime(22307): at org.fourthline.cling.android.AndroidRouter.enable(AndroidRouter.java:88)
02-27 15:34:17.992: E/AndroidRuntime(22307): at org.fourthline.cling.UpnpServiceImpl.<init>(UpnpServiceImpl.java:87)
02-27 15:34:17.992: E/AndroidRuntime(22307): at com.ventismedia.android.mediamonkeybeta.upnp.UpnpBrowseService$3.<init>(UpnpBrowseService.java:158)
02-27 15:34:17.992: E/AndroidRuntime(22307): at com.ventismedia.android.mediamonkeybeta.upnp.UpnpBrowseService.onCreate(UpnpBrowseService.java:158)
02-27 15:34:17.992: E/AndroidRuntime(22307): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2653)
02-27 15:34:17.992: E/AndroidRuntime(22307): at android.app.ActivityThread.access$1600(ActivityThread.java:150)
02-27 15:34:17.992: E/AndroidRuntime(22307): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1326)
02-27 15:34:17.992: E/AndroidRuntime(22307): at android.os.Handler.dispatchMessage(Handler.java:99)
02-27 15:34:17.992: E/AndroidRuntime(22307): at android.os.Looper.loop(Looper.java:137)
02-27 15:34:17.992: E/AndroidRuntime(22307): at android.app.ActivityThread.main(ActivityThread.java:5191)
02-27 15:34:17.992: E/AndroidRuntime(22307): at java.lang.reflect.Method.invokeNative(Native Method)
02-27 15:34:17.992: E/AndroidRuntime(22307): at java.lang.reflect.Method.invoke(Method.java:511)
02-27 15:34:17.992: E/AndroidRuntime(22307): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
02-27 15:34:17.992: E/AndroidRuntime(22307): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:561)
02-27 15:34:17.992: E/AndroidRuntime(22307): at dalvik.system.NativeStart.main(Native Method)

I assume that it is related to problem described here:
http://httpcomponents.10934.n7.nabble.com/java-lang-NoSuchMethodError-org-apache-http-conn-scheme-Scheme-lt-init-gt-td18698.html

I don't use anything from old HttpClient in my project. I rewrote everything to use the repackaged library (as adviced in the forum). But Cling still uses the android's HttpClient.

I am not using maven and don't have any apache http components libraries attached to my project.

I thought that someone had to face the same problem, but I didn't find it here. Please help, thanks.
Marek
Reply | Threaded
Open this post in threaded view
|

Re: Problem with old HttpClient in Android

Christian Bauer
Administrator

com.ventismedia.android.mediamonkeybeta.upnp.UpnpBrowseService$2.createStreamClient(UpnpBrowseService.java:110) 

That's your class. You instantiate the wrong thing. Cling 2 has a completely different UpnpServiceConfiguration for Android.

Reply | Threaded
Open this post in threaded view
|

Re: Problem with old HttpClient in Android

bhiefer
Great, I didn't switch it to jetta. Thanks