Friday, 5 June 2015

Adding gradle dependencies when library package name is not known

Im an android developer who recently moved to Android Studio. I had this problem of finding a library dependency name that I needed to declare in the gradle. The problem started when I was trying to add the Volley library to my project, I searched all over to find the relevant package of volley which needs to be declared in the dependency set and when I tried to use the
https://android.googlesource.com/platform/frameworks/volley
The gradle build failed, and I couldnt find a proper package name. So, I thought to share with you how to add a dependency whose package name you don't know in the android studio gradle. Please follow these steps:

  1. Right click your project name (say app)
  2. Open Module Settings
  3. Select Dependencies tab
  4. Click on the + sign in the top right
  5. Choose Library Dependency
  6. In the window that opens type the library file's name(say volley) 
  7. Double click on any library file and click Ok

You will see the dependency added in your gradle and the gradle auto sync has been initiated.

No comments:

Post a Comment