Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpClientBuilder is no longer supported on Android starting SDK version 23. #146

Open
scimetfoo opened this issue Sep 27, 2015 · 2 comments

Comments

@scimetfoo
Copy link

It isn't possible to instantiate RedditClient with HttpClientBuilder anymore, if an Android project is using the latest SDK. Maybe it's time to start migrating toOkHttpClient?

RedditClient client = new RedditHttpClient(REDDIT_USER_AGENT, HttpClientBuilder.create().build());

is no longer supported.

@theshapguy
Copy link

You'll need to add

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"
//The following line
    useLibrary 'org.apache.http.legacy'
    ...
}

@hmble
Copy link

hmble commented May 9, 2018

As shown in this SO answer by user Jinu

If you are using target sdk as 23 add below code in your build.gradle


android{
    compileSdkVersion 23
    buildToolsVersion '23.0.1'
    useLibrary  'org.apache.http.legacy'
}

and change your buildscript to

classpath 'com.android.tools.build:gradle:1.3.0' 

For more info follow this link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants