After upgrading SDK Tools to revision 22 classes from jars from library project (placed into its libs directory) are not visible in application project (which is dependent from library project). It is not working in Eclpise (will not even compile) nor from ant commandline (project is compiling fine but NoClassDefFoundError
is thorwn at runtime). I've tried symlinking and copying libs folder with no success.
Asked
Active
Viewed 3,379 times
4

koral
- 2,513
- 1
- 32
- 41
-
you should refer the library project in your android project. 1. http://developer.android.com/tools/projects/projects-eclipse.html. 2. http://developer.android.com/tools/projects/index.html – Raghunandan May 16 '13 at 12:27
-
Library project is added as a reference. Classes from it (itself) are visible. – koral May 16 '13 at 12:38
-
then what is the problem?? – Raghunandan May 16 '13 at 12:39
-
Classes from JARs placed in libs folder of library project are not visible. – koral May 16 '13 at 12:40
-
i am confused. can you be bit more clear.1. Do you have a library project ( which is different from jar) and you need to refer the same in your project. 2. You have a jar and you have addes it to libs folder. Assuming jar files only have .java files – Raghunandan May 16 '13 at 12:42
-
I have library project which contains source code and JARs (inside `libs `folder eg. ACRA, android support library). This library projecr is referenced in many application projects. Classes compiled from source are visible and it is OK. The problem is that classes from JARs are not visible. – koral May 16 '13 at 12:44
-
then you need to refer you library project in your android project. No need to add it to libs folder. Just refer clean and build and run – Raghunandan May 16 '13 at 12:46
-
Try the answer in the link http://stackoverflow.com/questions/16583118/google-maps-api-v2-class-not-found/16583424#16583424 – Raghunandan May 16 '13 at 12:48
-
I've done it but without success. It was working in ADT 21 but not in 22. – koral May 16 '13 at 12:57
2 Answers
3
Finally I found the solution:
- in main folder of application project create a symlink named
libs
pointing to correspondinglibs
folder in library project or link particular JARs (copying may be used instead of linking) - in project properties->Java Build Path->Order and export check the chekboxes for Android Dependencies and Android Private Libraries

koral
- 2,513
- 1
- 32
- 41
-
3I didn't have to do step one but two worked for me. Thanks for posting your answer – cottonBallPaws May 16 '13 at 16:44
1
ADT 22 add Android Private Libaries reference project/libs, if you wana reference the other project, You must check the Java Build Path --> Order and Export check the Exported, and clean projects.

Crossle Song
- 10,104
- 2
- 29
- 38
-
1It is sufficient for project without JARs in referenced libraries. If your library project contains JARs (not included also directly in application project) then you have to link/copy these JARs additionally. – koral May 16 '13 at 14:11