"Unable to get system library for project" after I upgraded to Android SDK 2.3 and ADT 8.0
Solution 1
That is rather difficult to answer, given the limited information you have supplied. Here are some suggestions:
Make sure that an appropriate
android.jar
is in your build path, since that is wherejava.lang.Object
would come from.Do a Project > Clean, to make sure you have 1.6
.class
files, in case that is part of the problem.Try creating a new project from scratch and see if that works.
Solution 2
For me, the problem was that in the Project settings - Android tab, I had no Android version selected.
Solution 3
I had this problem even though I had a valid target selected. I fixed it by changing to a different target, applying changes and then changing back. That seems to have sorted it.
Solution 4
Project->Properties->Android : Select another Android Target (in my case Android 4.0.3) -> Apply changes. THEN select again your default Android Target, and that is all.
Hope this help.
Solution 5
This problem was caused for my old projects on a new machine that did not have an older Android SDK installed.
To fix, simply go into project.properties and observe your old version number:
# Project target.
target=Google Inc.:Google APIs:3
Simply update the version number, like so:
# Project target.
target=Google Inc.:Google APIs:7
You will find that Eclipse then picks up the right SDK version and starts working.
Jonas
Passionated Software Developer interested in Distributed Systems
Updated on November 18, 2020Comments
-
Jonas over 3 years
Today I upgraded to Android SDK 2.3 and I also upgraded the Eclipse Plugin Androi Developer Tools 8.0 (from 0.9.9). I also upgraded my Java Development Kit to 1.6_22.
Now in Eclipse I get many errors in all my Android projects.
The error messages are like:
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files.
How can I fix this so I can use my Android projects again?
In the Build Path for these projects, I don't have any references to an
android.jar
but a message:Unable to get system library for project
-
Jonas over 13 yearsThe
android.jar
seems to be in my Build path. I have already tried withClean
but it doesn't help. I get the same errors when I create new projects. -
Jonas over 13 yearsIf I look in the Properties for my project, under "Java Build Path" there is a message:
Unable to get system library for project
. I think this is the problem, but I don't know how to fix it. -
CommonsWare over 13 years@Jonas: Go into Window > Preferences > Android and make sure your SDK is still configured with the appropriate directory.
-
Jonas over 13 yearsI was wrong, I just get this error on old projects and not on new projects and the old doesn't seem to have an
android.jar
in the build path, but a messageUnable to get system library for project
. -
CommonsWare over 13 years@Jonas: You might get that if you have your project configured for some target that you no longer have on the system (e.g., you removed it as part of your round of upgrades). In the project properties dialog, go into the Android area and make sure you have a valid target checked.
-
Jonas over 13 yearsThanks, that fixed most of the problems. No target were selected. But I use
MapView
from Google Maps in one project, and I don't have a target with Google Maps API. -
velazcod over 13 yearsUpdate your ADT on eclipse, they just pushed a new version to deal with some bugs: twitter.com/#!/romainguy/status/12222143299330050
-
Jonas over 13 yearsI actually fixed this problem as CommonsWare described. And now I upgraded to ADT 8.0.1 and got the same problems again, but his fix solved it again.
-
Thomas Ahle almost 13 yearsFor me too, but with the addition that selecting a version in the Androids simply unset itself after reopening the preferences.
-
Thiago Cardoso over 12 yearsI had this same problem and I solved it with @CommonsWare comment (the 3rd one).
-
Nilesh Gawade over 12 yearsafter that clean the project and then try to run it
-
acedanger over 11 years@CommonsWare's comment resolved it for me as well. Thank you!
-
Robin Davies over 11 yearsWorked for me. The project was referencing SDK 9 (which wasn't installed). When I edited the android version in the UI, the checkboxes wouldn't stay checked. Editing project.properties fixed things and allowed me to select the correct SDK version.
-
Carl over 11 yearsYes, this actually re-created the entry for (in my case) Android 2.2 in my Java Build Path, which had been replaced by "unable to get system library for the project" after I installed a number of items. Now everything works as before.
-
gonzobrains about 11 years@CommonsWare You are a true Android Patriot! Suddenly all my errors disappeared in one fell swoop! Thanks!
-
n611x007 over 10 yearsticking in one of the boxes in <project> ->
Properties
->Android
->Project Build Target
did it. There was none selected. Strange. I've also copiedandroid-support-v4.jar
to a freshly-created<project's root>/libs
folder - don't know if it has to do with anything because in itself it didn't help, but then the tick did. -
Andrew about 10 yearsThis is held under Project/Properties (not Settings) on my version of Eclipse. The solution (changing Android 4.3 Build Target from unchecked to checked) worked for me, but I don't understand how it became unchecked - the project worked fine earlier and seemed to stop working without any significant change.
-
zungnv about 10 yearsThanks, it works. Somehow it lost the path to android.jar, just uncheck and check again , it will work
-
n611x007 over 9 yearswhat information should have been given, so it wouldn't be "
limited
" any more? -
n611x007 over 9 yearsI had a target selected, out of the three I'd installed, but selected a different one anyway, applied, then selected the original one and applied. then build. it fixed for me. just like Iker Martin's answer
-
Kristy Welsh over 8 yearsI also just closed and then reopened the project then everything worked.
-
Neeraj Krishna over 8 yearsWorked for me too on Android 6.0