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 default.properties 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 "project.properties" 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
# 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
# "ant.properties", 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
- create a new workspace
- import library project in that workspace
- import the desired project in that workspace
- having both project and library project the same target android os version
- 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:
- import and copy all project data including library project into workspace
- 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
- clean project first (to refresh ur project properties)
- go to library project properties-->android-->library and check the is library if it does'nt click apply then ok
- if the library project is library is already checked, first unchecked it then clean the library project after that do the step 4 again
- 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
- 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 "project.properties" 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 project.properties 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).
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 project.properties. 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):
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.
- In eclipse, unable to reference an android library project in another android project
- Android project unable to reference other project in eclipse
- Eclipse Android project losing reference to library project - ViewPagerIndicator
- Cannot reference an android library project in Eclipse
- Unable to import library project and sample given for tooltip in eclipse for android
- How to add android library project in another android project in eclipse
- What is the recommended way to reference an Android library project in Eclipse
- unable to run android project as eclipse considering it as a library
- unable to get system library for the project on eclipse ide
- Android Studio - Library reference ../google-play-services_lib could not be found importing project
- Eclipse Android project, how to reference library within workspace?
- How to import eclipse library project from github to android studio project?
- Is it possible to read a raw text file without Context reference in an Android library project
- Cannot Add Library to Android Project in Eclipse
- How to reference another project in Eclipse with Google appengine project?
- Add a non-Android library project to an Android app in Eclipse
- Importing an app-compat v7 library eclipse project to android studio
- How can I reference another project in Eclipse Java EE projects?
- How can I reference libraries in another project within Eclipse Helios?
- Android project in Eclipse is missing the Android 4.2.2 library folder
- How to include http library in Android Project using M preview in Eclipse ant build
- Eclipse CDT: Make a project rebuild when a library built in another project was rebuild
- Android Library project can't import R class of another library project when using gradle to compile on command line
- Cannot Reference LVL Android Library in my App Project
- Can't reference an Android library into my project
- java servlet project and android library project in eclipse - NoClassDefFoundError
- Android: How to reference a library project from an Eclipse ADT application project?
- Eclipse unable to resolve akka reference in maven project
- Android problems when import library project using Eclipse
- Android using AndroidAnnotations in Library Project Eclipse
More Query from same tag
- Eclipse editor runs slow on Ubuntu 16.04 after first project build
- Ambiguous Constructor reference in javac but not in Eclipse
- Thread doesn't start until application restarted on Android
- The archive: /common-entity/target/common-entity-1.0.0-SNAPSHOT.jar which is referenced by the classpath, does not exist
- How to enable debug on my JUnit through Gradle test task
- How to join 2 APKs into 1 APK?
- Return a value from asynchronous call to run method
- Unit testing for java program
- WARN: No coverage recordings found. No report will be generated
- eclipse autocompletion from class file?
- Is there a way to get Eclipse to treat 4 spaces exactly as it treats a tab?
- Unable to install BlackBerry Plug-in for Eclipse (Broken Repo link)
- Practise remote debugging on local glassfish server?
- Maven in Eclipse project: package javax.ws.rs does not exist
- Eclipse getting crashed after throwing "Throwable during asyncExec Malformed class name"
- TraceView Eclipse not working
- How can I set primary key in particular text field?
- C programming multiple definition error
- Want to use both older and newer version of ant plugin in eclipse for two different projects
- Install clearcase for eclipse 3.5.2 on linux
- How to find ~/.android/debug.keystore in Mac OS X for Android?
- Making User-Made Java Classes Available To All Eclipse Projects
- Why is my Eclipse launch configuration not being added to the Run or Debug configurations list?
- Eclipse IDE content assist for custom XMLs
- Issue uploading jar-files to Azure Web App
- Error running *.c file in Eclipse Kepler
- Eclipse Luna Quick Search Command
- How to deploy "ear" project from Eclipse or JBoss Studio to JBoss or Wildfly app server
- How to control a View on selecting particular File Type in Eclipse Editor
- Can we replace a char with its decimal escape code?