3

I'm using the Android SDK as a standalone version (since I don't like IDEs very much).

However, now I wanted to use the Support Libraries and downloaded them with the ./android tool. And I checked that the /extras/android/support/v4/android-support-v4.jar exists.

Yet, my compiler doesn't seem to recoginize them (error: package android.support does not exist). I believe that I have to get them in my classpath somehow, but have no idea how this should work (on the android page it is only explained for IDEs).

Any suggestions?

Grzegorz Żur
  • 47,257
  • 14
  • 109
  • 105
Stefan
  • 157
  • 9

2 Answers2

3

While the Android Support library documentation focuses on the two main IDEs, the documentation on command-line projects has instructions on how to reference an Android library project.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

I needed to specifically get the support libraries (a jar file) to be included in a legacy ant-based Android build, and I wasn't able to get the command line suggested by the links from CommonsWare to work (specifically, the suggestions from https://developer.android.com/tools/projects/projects-cmdline.html#ReferencingLibraryProject required that I actually have a full project to reference.)

As it turns out, all I had to do was put the support library jar (eg: android-support-v4.jar) in the project's lib directory and everything worked. That may be specific to the ant build I'm using, but I think it's the same build file that the google tools used to generate.

rcreswick
  • 16,483
  • 15
  • 59
  • 70