jReddit / jReddit

:cyclone: Java wrapper for Reddit API
https://jreddit.github.io/
MIT License
195 stars 116 forks source link

HttpClientBuilder still incompatible with API 26 on Android #152

Open liamrathke opened 6 years ago

liamrathke commented 6 years ago

Hey,

I'm pretty sure that there are still some issues with HTTPClientBuilder when used with Android API 26. I am unable to run my app since I can't get the BasicLineFormatter to download from Android.

03-17 14:44:16.407 27293-27293/edu.tjhsst.api E/AndroidRuntime: FATAL EXCEPTION: main Process: *******, PID: 27293 java.lang.NoSuchFieldError: No field INSTANCE of type Lorg/apache/http/message/BasicLineFormatter; in class Lorg/apache/http/message/BasicLineFormatter; or its superclasses (declaration of 'org.apache.http.message.BasicLineFormatter'

Per the other issue's suggestion, I've also tried using useLibrary 'org.apache.http.legacy', but that hasn't resolved the error.

Are there any ways to resolve this conflict?

hmble commented 6 years ago

As shown in this guide as an alternative to Apache HttpClient we should use HttpURLConnection

To use this library you can use useLibrary 'java.net.URLConnection'