mcxiaoke / android-volley

DEPRECATED
4.29k stars 1.56k forks source link

Apache packages is removed since Android SDK Level 23. #92

Open bytebeats opened 9 years ago

bytebeats commented 9 years ago

I opened this project in Android Studio by Github. After gradle.properties was changed like this:

ANDROID_BUILD_TARGET_SDK_VERSION=23
ANDROID_BUILD_TOOLS_VERSION=22.0.1
ANDROID_BUILD_SDK_VERSION=23

this master project couldn't be compiled successfully.

And as far as I know, apache httpclient packages in Android Pre-Marshmallow are removed since then Android SDK 23.

So, what changes would volley make then for the sake of removal of apache in Android SDK?

NetRally commented 9 years ago

Maybe it helps: add to build.gradle     compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'

bytebeats commented 9 years ago

It was said that a org.apache.http.legacy.jar in Android/sdk/platforms/android-23/optional, then how could I add this jar into my Android Studio? Put it into libs and then add as a library?

stateofzhao commented 9 years ago

as @LittlePanpc answer ,i get org.apache.http.legacy.jar in Android/sdk/platforms/android-23/optional,and Put it into libs and then add as a library.

chris-feist commented 9 years ago

This is how you add the legacy jar. Make sure you are using the latest gradle too.

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

    useLibrary 'org.apache.http.legacy'
    ...
}
shic commented 9 years ago

@f3ist added useLibrary, but got: can not solve the symbol "useLibrary" error

panxw commented 9 years ago

@LittlePanpc

I build a branch which no Apache http need, you could try~ https://github.com/panxw/android-volley-manager

eirnym commented 9 years ago

@shic You should use newer grade and android grade build tools to use useLibrary

thevirus20 commented 9 years ago

@panxw Did u change the repo?Is this the one you have build? https://github.com/panxw/android-volley-manager

panxw commented 9 years ago

@thevirus20 yes, I'm trying to use gradle.

thevirus20 commented 9 years ago

So both(this one and yours) are same in terms of usage or you have renamed/removed/introduced some method while porting to Google recommended URLConnection?

arpit009 commented 9 years ago

If above solution is not work then try my solution

I experienced this problem recently, and it is caused by the path length restriction I think it´s 256 characters maximum.

Relocate your Project and the build will succeed.