{"action":"created","issue":{"url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/3626","labels_url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/3626/labels{/name}","comments_url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/3626/comments","events_url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/3626/events","html_url":"https://github.com/ankidroid/Anki-Android/issues/3626","id":103732436,"number":3626,"title":"Remove dependence on deprecated Apache HTTP client","user":{"login":"timrae","id":2818274,"avatar_url":"https://avatars.githubusercontent.com/u/2818274?v=3","gravatar_id":"","url":"https://api.github.com/users/timrae","html_url":"https://github.com/timrae","followers_url":"https://api.github.com/users/timrae/followers","following_url":"https://api.github.com/users/timrae/following{/other_user}","gists_url":"https://api.github.com/users/timrae/gists{/gist_id}","starred_url":"https://api.github.com/users/timrae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timrae/subscriptions","organizations_url":"https://api.github.com/users/timrae/orgs","repos_url":"https://api.github.com/users/timrae/repos","events_url":"https://api.github.com/users/timrae/events{/privacy}","received_events_url":"https://api.github.com/users/timrae/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-08-28T14:49:15Z","updated_at":"2015-11-03T09:13:44Z","closed_at":null,"body":"[Android Marshmallow has removed the Apache HTTP client](https://developer.android.com/preview/behavior-changes.html#behavior-apache-http-client). \r\nConsequently, AnkiDroid doesn't compile with SDK 23.\r\n\r\nThe `useLibrary` workaround given by them did not appear to fix the broken import of `org.apache.http.HttpResponse`. \r\n\r\nI have no idea why that didn't work, but it's probably not a good idea to keep using it anyway. According to [this stackoverflow](http://stackoverflow.com/questions/30556605/org-apache-http-httpentity-is-deprecated-how-to-solve-this-error-in-android-s):\r\n\r\n> If you need to continue using the HttpClient API, consider switching to [OkHttp][2] and their HttpClient compatibility layer, or consider switching to [Apache’s separate Android edition of HttpClient][3]. Otherwise, switch to HttpURLConnection or OkHttp’s native API.\r\n\r\n  [2]: http://square.github.io/okhttp/\r\n  [3]: https://hc.apache.org/httpcomponents-client-4.3.x/android-port.html"},"comment":{"url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/comments/153293950","html_url":"https://github.com/ankidroid/Anki-Android/issues/3626#issuecomment-153293950","issue_url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/3626","id":153293950,"user":{"login":"timrae","id":2818274,"avatar_url":"https://avatars.githubusercontent.com/u/2818274?v=3","gravatar_id":"","url":"https://api.github.com/users/timrae","html_url":"https://github.com/timrae","followers_url":"https://api.github.com/users/timrae/followers","following_url":"https://api.github.com/users/timrae/following{/other_user}","gists_url":"https://api.github.com/users/timrae/gists{/gist_id}","starred_url":"https://api.github.com/users/timrae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timrae/subscriptions","organizations_url":"https://api.github.com/users/timrae/orgs","repos_url":"https://api.github.com/users/timrae/repos","events_url":"https://api.github.com/users/timrae/events{/privacy}","received_events_url":"https://api.github.com/users/timrae/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T09:13:44Z","updated_at":"2015-11-03T09:13:44Z","body":"> I think we should stick to the useLibrary approach to avoid any more surprises for this release. It's been working fine up to this point, and we can't really tell if any of the updates to the underlying libraries have any effect for us.\r\n\r\nAgreed. I'll probably push a PR through tomorrow.\r\n\r\n>> You mean that the other way around, right?\r\n\r\n> Okay I guess not. I'll read up on this later. It's a bit confusing.\r\n\r\nYeah it's not really obvious from the AOSP code that it's using OkHttp, but [it is](https://twitter.com/jakewharton/status/482563299511250944). I saw it boil up on a stacktrace in the Acra library once. I was thinking it could be less effort if the OkHttp API is more similar to the Apache one than it is to the Android one, but the native Android API is the least likely to change, so should be the \"best\" assuming it does everything that we need it to.\r\n\r\n "}}