-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New Android 5.1 Deprecated classes which could affect on the library in future #830
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
Comments
Maybe you could transfer to android volley, or implement this library by URLConnection. |
smarek has said that the library will use a port of the Apache HttpClient for future releases as the version shipped with Android is frozen (and now deprecated) at 4.0 beta. "in branch 1.5.0 we plan on go away from Android provided version of HttpClient and replace it with android port" -smarek #775 |
Thank you and yes, I'll be pushing 1.5.0 branch forward, so we won't fall into problems as those classes will be removed in future Android version. |
Apache HTTP has been removed from the M preview: http://developer.android.com/preview/behavior-changes.html |
@kjkrum Android-async-http works well on Android M, I debuged this last week |
@titanseason should not work, how come? |
@titanseason What version? Only the 1.5.x branch should work on M. If an earlier version works, Google might have "removed" Apache HTTP by removing it from the Android SDK stub library, similar to the way they remove methods with the |
(Though that would be a gamble, since Google might actually remove Apache HTTP at some point in the future.) |
@kimiyash Android-async-http (Version 1.4.6) works well on my Nexus 5. By the way, my Android project target in project.properties is "target=android-19" |
Then they must have only removed Apache HTTP from the stub library. Version 1.4.x will continue to run, it just won't be compilable against M or later SDKs. |
Will HttpClient be replaced by HttpUrlConnection or other alternative in android-async-http? I think this is a final solution. |
Nope, we discussed this already, and there are already good libraries based on HttpUrlConnection, we're not going to implement that again. Version 1.5.0 (as soon as I get some time to push it forward) will be based on Apache HttpComponents 4.3+ (see #830 (comment) and #775) |
If you change your target sdk to Android M (API 23) then all deprecated classes related to HTTP client are no longer available and Android-async-http won't work. You need to add "useLibrary 'org.apache.http.legacy'" in your gradle configuration. |
There is a |
give a tip for someone just like me, do not know how to add "useLibrary 'org.apache.http.legacy'"
|
wow, i am sorry to said that, there is still a compile issue said that org.apache.http related class can not found, even after i added useLibrary 'org.apache.http.legacy' in my project's gradle configuration. @gmbett , does |
@zhangchaoxu thanks for the tips on the workaround. Hopefully, @smarek will be able to resolve this for 1.5.0. Granted, I'm sure it will take quite a bit of work to refactor it so that there are no dependencies on org.apache.http.Header. |
@zhangchaoxu, did you have to do anything to your project after copying org.apache.http.legacy.jar to your libs folder? My project still shows compilation issues after doing this. |
Have you tested it on a device, or just compiled it? My understanding is that |
@TylerMcCraw @kjkrum |
@kjkrum |
I thought someone assigned himself this issue. Else we should try to port On Wed, 2 Sep 2015 06:58 Dennis Jung [email protected] wrote:
|
@griffins I'm assigned but I don't have the time to fix all this right now. There are good HttpUrlConnections based async http requesting libraries out there, but this one was and will be based on HttpClient, no need to do just another library like those. We need to have JAR of Apache HttpClient components (all of them) but not under org.apache, as that would cause classpath conflicts, but under different namespace (such as Something like that was done previously, see HttpClientAndroidLib project (now unmaintained and deprecated) https://code.google.com/p/httpclientandroidlib/ More info on the topic, see: |
I look at it tomorrow. Probably ill have an idea on wat to try after that. On Wed, 2 Sep 2015 21:00 Marek Sebera [email protected] wrote:
|
Again, this library CANNOT be ported to use |
@griffins so I have it working, see repository here: Currently requesting artifact group and id on Sonatype Nexus repository, and I'll push updated android-async-http library with this as dependency, instead of HC teams repackaged version or request has been placed in OSSRH-17531 https://issues.sonatype.org/browse/OSSRH-17531 |
@smarek Any idea on when the updated android-async-http library with this change will be released? Thanks so much for all the help and work with this great library. |
@jeremylan I should be able to do it through the weekend, there are changes needed to be done along using 4.3.3 upstream HttpClient, before the release is feasible. |
@smarek Thanks heaps for the reply and all the work. All the best. |
Thanks @smarek! |
So now we're officially running on stable upstream HttpClient 4.3.3 version, repackaged and published on Maven through group+artifact Code was updated to new dependency, and all tests run smoothly, compiled against latest Android SDK 23, see commit for reference 15f9556 To convert your current code, simple solution is to use sed to replace
Sincerely we're not allowed to publish to maven under I've just uploaded new For those who'll be testing build from source, there is also fix to get correct javadocs generated on project, see a5399d8 for reference Please all of you, who watch this ticket, try this snapshot, and I'll solve some issues along the way on the 1.4.9 release, before publishing the non-SNAPSHOT version into central. |
Hi @smarek I just tested the 1.4.9 snapshot with my code, compiled with API 23 and running in API 19 and API 23 emulators. It all seems to work OK, thank you! |
Cool, can anybody else please confirm this finds? Also I'd be greatful for tests done on API3-API10 (as we still declare the compatibility), if anybody is willing to do that. |
Used the 1.4.9 snapshot and replaced the necessary imports and can confirm it works |
same as @LaurieScheepers, it works. |
Heads up, I've just released 1.4.9 to Maven Central repository, updated master branch with latest code, uploaded new javadocs, updated readmes with new version. Also we're now sitting on top of HttpClent 4.3.6 ( https://github.com/smarek/httpclient-android/releases/v4.3.6 ), which already includes HttpClient-Cache and HttpMime libraries of same version, so you can drop the external dependencies, if you're using any. 1.5.0 built on top of upstream 4.3+ (hopefully we'll manage to get to 4.4+ or even 4.5+) has a lot of issues to be solved, so I'd welcome any help on updating the library according to our options, now since we're not relying on Android provided HttpClient anymore. 1.4.9 will remain as LTS version, and I plan to upload minor revisions, however no big changes will get merged into 1.4.9.X versions Thank you all for your contribution. |
@smarek awesome, I'll update to the new official version tomorrow. Thanks 👍 |
Great work @smarek !! |
@smarek Thank you so much for 1.4.9 you saved my but and a whole lot of time. |
I made one base on Android Volley, no HttpClient(apache http) need now! |
@panxw Bad idea to set Android API 14+ |
@LittlePanpc It's Android API 9+ ok now! |
@panxw good for you, closing for Off Topic discussion reasons |
This is from the new Android 5.1 APIs update. https://developer.android.com/about/versions/android-5.1.html#http
The text was updated successfully, but these errors were encountered: