unable to get system library for the project on ec

2020-05-14 03:14发布

enter image description hereI was working on an android tutorial and it wanted me to import the library from another project .The import worked and the project works correctly. But I noticed that doing that messed up several of my other projects (the ones that use Android 2.1) by apparently messing with the build path. Now instead of seeing "Google APIs [Android 2.1]" under the gen folder I see "Unable to get system library for project".

I verified the following:

I right-clicked the project and went to Properties I see that the correct Project Build Target is checked(Google APIs [Android 2.1]), but "Unable to get system library for project" is still shown above the assets folder and below gen and Android Dependencies. Cleaning all projects doesn't help.

How can I fix this problem? is there a way to fix this issue globally or do I have to do it one by one?

9条回答
Bombasti
2楼-- · 2020-05-14 03:32

Error in .classpath on your project. It not connect to android sdk. Fix it and clean project. :-)

查看更多
啃猪蹄的小仙女
3楼-- · 2020-05-14 03:32

You need to click on the menu icon with the Android sitting in the grey box with a white arrow pointing down "Opens the Android SDK Manager".

Opens the Android SDK Manager

or, from the command line, run:

%ANDROID_HOME%\tools\android sdk
查看更多
啃猪蹄的小仙女
4楼-- · 2020-05-14 03:33

For me the project.properties file was missing (it was code from a repo I checked out). So I just created one with this line:

target=android-20

After that, Erhannis' solution worked for me.

查看更多
爷、活的狠高调
5楼-- · 2020-05-14 03:33

At times, when only single Android SDK version is installed on your system, and if it gets changed either by un-installing / re-installing Eclipse, or otherwise (directly through SDK Manager), then this issue might crop up. . This is accompanied by the message like this on Eclipse console:

YourApp] Unable to resolve target 'android-22'

. A simple workaround to this issue is:

  1. Open AndroidManifests.xml of the project, and in the:
<uses-sdk
   android:minSdkVersion="14"
   android:targetSdkVersion="21" />

change the targetSdkVersion to the one currently installed on your system

  1. Next, open the project.properties file and update

    target=android-21

to your current SDK version

  1. Finally, clean and re-build the project
查看更多
ら.Afraid
6楼-- · 2020-05-14 03:34

This happens when you are targetting an API version that for some reason is not mapped on your buildpath.

  1. See which is the version of the SDK you are pointing to at the project.properties file.
  2. Go to the SDK Manager at Window->Android SDK Manager
  3. Check the Android API item that matches the version you want to use, OR, click on the latest one and then update your project.properties file.
  4. Make sure your project build configuration is Project->"Build Automatically"
  5. Retsart Eclipse (claning and rebuilding may not refresh all the project properties)
查看更多
Juvenile、少年°
7楼-- · 2020-05-14 03:37

Just for completing Erhannis answer: If you fixed the problem but it appears again when you restart Eclipse, then just go to the file local.properties on your workspace folder and verify that the location of the Android SDK there is correct.

查看更多
登录 后发表回答