Accepted answer

ok here is the solution which i found when i was looking for the default.properies file of the referencing project (not the library) in my file system. although the referencing project was in the same eclipse workspace as the library project, the actual files were somewhere else in the file system ie they were'nt in the same parent folder of the library project. as soon as i placed the referencing project in the same physical folder as the library project it all went fine.

i guess that this must be something to do with android using ant underneath the covers.

edit: the project name needs match the folder name on the file system. what you are seeing in the project properties->android->library reference is a relative file system path.


when you have a look at the reference-path before and after, it comes from i.e. "c:/workspace/mylib" and goes to "../../mylib" when copied to the correct location, quite interesting.



what worked for me was to delete the 'library' projects (the actual projects) from my workspace (without deleting the files), and then re-importing them using the wizard (import existing android project from source code).


thanks for posting the question. i had exactly the same problem while integrating facebook with my android application. i fixed the issue by moving my development project to the same windows drive in which library project was located. somehow eclipse is unable to read the library project's location properly from file if it is in a different drive.


similar to sufi khan's post i also solved this issue with a reboot. my case differed in that when i first accessed properties->android and added the library i got a lovely green checkmark. when i closed the dialog eclipse was still showing class-not-found type errors. when i checked the properties again i saw the red x. but mr. kahn's solution (delete the bad lib, restart eclipse, add the lib again) worked fine.

i'm using the 0702 version of the adt bundle (starts with "cluster", rhymes with "duck").


i followed the accepted answer but also had to make sure my "" file was readable.

if the file is readonly (checked into source control) eclipse will not edit it. adding the library reference will succeed, but the change won't be persisted after hitting ok.

if closing the preferences window and reopening in again removes the library you just added, this may be your solution.


in case your library project still doesn't show up try adding library flag in your library project properties

add android.library=true

# this file is automatically generated by android tools.
# do not modify this file -- your changes will be erased!
# this file must be checked in version control systems.
# to customize properties used by the ant build system edit
# "", and override values to adapt the script to your
# project structure.
# to enable proguard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):

# project target.


workaround for me was to

  1. create a new workspace
  2. import library project in that workspace
  3. import the desired project in that workspace
  4. having both project and library project the same target android os version
  5. reference library project in my project

solved my problem


i had the same problem there when i try to change my workspace so this my solution:

  1. import and copy all project data including library project into workspace
  2. delete the old project reference by right-click on the project-->properties-->android-->library, and select corrupted library(so that waht i call it) and choose remove
  3. clean project first (to refresh ur project properties)
  4. go to library project properties-->android-->library and check the is library if it does'nt click apply then ok
  5. if the library project is library is already checked, first unchecked it then clean the library project after that do the step 4 again
  6. go to project that u want the library are in then right-click on the project-->properties-->android-->library, add then choose the library project (it should be there) and click apply then ok
  7. if still doesn't appear clean the project once more time and that should do


just restart your eclipse. it's solve my problem


yet another observation on the same issue.

for me the two projects where on the same parent folder, and were both local inside the workspace. even then the issue was still happening.

the i edited the "" file and put the absolute path(with forward slashes '/' for seperator) of the library project. saved and closed it. then went to the project properties dialog, removed the library(which was still showing the cross icon but with abs path) and added it back as usual. surprisingly the issue is resolved, and the project compiles and runs.

this is really strange and must be a bug with the adt. i am using adt version 20.0.2


when developer referencing the facebook or any other library project then first of all clean the project from eclipse->project->clean project. that want allow the error of red cross in referencing screen.


for me, i just restart the eclipse and the added library works fine.

i mean first time it showing red marks after adding the library project. though eclipse main project and library project are in same workspace folder and no resources files are in outside of the project folder.

so, you can try with to restart your eclipse. happy coding....


please ensure that the library project is marked as "is library" - right click on the library project - properties - android - mark the "is library" checkbox - in of the library project you should have a new entry:"android.library=true. now add it into the project you want as described in the post below.(the post with image integrated - from nilesh pawar).


this bug is referenced several times here 27199, 35786, 36460 & 38052

maybe by voting for them, it will be fixed one day...


simplest way to get the library paths paths correct is to use the gui from eclipse to add the library as shown in the following screenshot and let eclipse take care of putting the correct relative paths in its a common setup to have your library projects hosted at directories vastly different than your main projects that uses the library. this method will work if the "libary project" and the project using it are in the same eclipse "workspace" (they "need not" be in same parent folder): enter image description here


the same problem will occur if your library project is in different partition from your current workspace. i have the same problem just now. my git source is in c: and i just move my workspace to d: and everything start to collapse.


make sure both the projects are present in same work space. to do it, while importing the projects make sure "copy project into work space" check box is checked.

Related Query

More Query from same tag