I added Google volley to my app project. However, now I can no longer compile it. When trying to Gradle sync I constantly get the following error message:
Error:Cause: failed to find target with hash string 'android-22' in: /Users/Tom/Library/Android/sdk
Open Android SDK Manager
I opened the SDK Manager and installed everything that was requested. However, I'm still getting the same error.
I did the following:
- git clone volley project
- In Studio: File -> New -> New Module -> Import Gradle Project -> selected volley folder
- Added
compile project('volley')
to thesettings.gradle
in the dependency part
In a comment, @Toom mentioned to use
This workaround was very useful at the time. Maybe there were many bugs in the official back in the day, I don't know, because I used this. Yet, it appears that this has been deprecated at 1.0.19 (Readme was updated in 2017). The repo can be found at https://github.com/mcxiaoke/android-volley . Today, the official is at 1.1.0 and documentation can be found at https://developer.android.com/training/volley/ . Other answers explain how to use this in your project.
I use Google's official volley library in my projects by the following steps:
android
folder into\app\src\main\java\com
folder path of my projectcompileSdkVersion 23
, then adduseLibrary 'org.apache.http.legacy'
intobuild.gradle
fileHope this helps!
Error:Cause: failed to find target with hash string 'android-22'
it means that the version of volley you imported has as dependency Android-22 (Android 5.1.1). Open the Android SDK manager and install it. After this error should disapper