Search code examples
javaandroideclipseandroid-volleybuildpath

Adding Volley library to android project in Eclipse Luna


I've created an Android project in Eclipse and I would like to add the Volley library to it. Searching on the web, I've tried these approaches:

  • Copy the .jar into the libs folder and right-click and add it to build-path.
  • Open the library as an android project, mark it as library and add it as a reference in my android app.

Nothing works. I still cannot access the classes provided by the library by importing the classes like follow: com.android.volley

Someone has a solution for this ?


Solution

  • The Solution:

    Try this:

    • Add volley.jar to the libs folder. Don't add it to the build path.
    • In Eclipse go to Project and make sure Build Automatically is selected.
    • Now in Project, click on Clean:

      Project -> select Clean -> select the project. 
      

    As Volley doesn't have any resources like styles, layouts etc., its not necessary to reference it as a library project. The above should work, provided all steps are followed.

    If this doesn't work ...

    Make sure the library has not been added to the build path. If it is, then remove it. Now, try:

    • Closing and re-opening the project.
    • Restarting the IDE (last resort).