{"action":"created","issue":{"url":"https://api.github.com/repos/twitter/hbc/issues/131","labels_url":"https://api.github.com/repos/twitter/hbc/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/twitter/hbc/issues/131/comments","events_url":"https://api.github.com/repos/twitter/hbc/issues/131/events","html_url":"https://github.com/twitter/hbc/issues/131","id":45920447,"number":131,"title":"Problem with Apache HTTP client","user":{"login":"shenghuang","id":2006683,"avatar_url":"https://avatars.githubusercontent.com/u/2006683?v=3","gravatar_id":"","url":"https://api.github.com/users/shenghuang","html_url":"https://github.com/shenghuang","followers_url":"https://api.github.com/users/shenghuang/followers","following_url":"https://api.github.com/users/shenghuang/following{/other_user}","gists_url":"https://api.github.com/users/shenghuang/gists{/gist_id}","starred_url":"https://api.github.com/users/shenghuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shenghuang/subscriptions","organizations_url":"https://api.github.com/users/shenghuang/orgs","repos_url":"https://api.github.com/users/shenghuang/repos","events_url":"https://api.github.com/users/shenghuang/events{/privacy}","received_events_url":"https://api.github.com/users/shenghuang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-10-15T21:12:36Z","updated_at":"2015-05-04T20:47:16Z","closed_at":null,"body":"I got the following error after importing Twitter HBC libraries into my Android project:\r\njava.lang.NoClassDefFoundError: org.apache.http.impl.conn.SchemeRegistryFactory\r\n            at com.twitter.hbc.ClientBuilder.<init>(ClientBuilder.java:102)\r\n\r\nSome Internet threads say the Apache HTTP client library collides with the Android built-in one, thus I added the following library dependency following https://hc.apache.org/httpcomponents-client-4.3.x/android-port.html\r\n    compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5'\r\n\r\nThis doesn't work as well. Now it complains some other errors. Another library\r\nhttp://code.google.com/p/httpclientandroidlib/ says it could work, but it requires to import ch.boye.httpclientandroidlib.* instead of org.apache.http.*. \r\n\r\nIt seems that org.apache.http.conn.scheme.SchemeRegistry is imported in https://github.com/twitter/hbc/blob/master/hbc-core/src/main/java/com/twitter/hbc/ClientBuilder.java, so I don't think it is a good idea to change the ClientBuilder class to change the import statement.\r\n\r\nIs there a solution? How can make the Twitter streaming work? Thanks in advance. "},"comment":{"url":"https://api.github.com/repos/twitter/hbc/issues/comments/98845779","html_url":"https://github.com/twitter/hbc/issues/131#issuecomment-98845779","issue_url":"https://api.github.com/repos/twitter/hbc/issues/131","id":98845779,"user":{"login":"Eugenijus","id":134793,"avatar_url":"https://avatars.githubusercontent.com/u/134793?v=3","gravatar_id":"","url":"https://api.github.com/users/Eugenijus","html_url":"https://github.com/Eugenijus","followers_url":"https://api.github.com/users/Eugenijus/followers","following_url":"https://api.github.com/users/Eugenijus/following{/other_user}","gists_url":"https://api.github.com/users/Eugenijus/gists{/gist_id}","starred_url":"https://api.github.com/users/Eugenijus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eugenijus/subscriptions","organizations_url":"https://api.github.com/users/Eugenijus/orgs","repos_url":"https://api.github.com/users/Eugenijus/repos","events_url":"https://api.github.com/users/Eugenijus/events{/privacy}","received_events_url":"https://api.github.com/users/Eugenijus/received_events","type":"User","site_admin":false},"created_at":"2015-05-04T20:47:16Z","updated_at":"2015-05-04T20:47:16Z","body":"I have the same issue when trying to use hbc-core in android development (Android Studio). I get:\r\njava.lang.NoClassDefFoundError: org.apache.http.impl.conn.SchemeRegistryFactory\r\n\r\nIn my gradle dependencies I added these lines:\r\ncompile 'org.apache.httpcomponents:httpclient:4.2.5'\r\ncompile 'com.twitter:hbc-core:2.2.0'\r\n\r\nBut when I open ClientBuilder.java the following import still cannot be found:\r\nimport org.apache.http.impl.conn.SchemeRegistryFactory;\r\n\r\nI tried httpclient 4.4.1 as well. My App is targeted for minSdkVersion 17 and targetSdkVersion 21.\r\n\r\nThis is very cool project/library and it would be awesome if it worked on Android as well."}}