42

When I start up my Android ADT most if not all of my projects have a red exclamation next to them. And when I try to build and run them I get an error:

"google-play-services_lib] Unable to resolve target 'android-9'"

I am not sure what this means as I am up to date with my updates with my Android SDK manager.

I have tried restarting eclipse. I have tried downloading another Android SDK and running from there but still the same error.

Please help guide me into the right direction.

8 Answers 8

130

Actually downloading the latest ADT bundle for Eclipse gives the same error when trying to import the google_play_services_lib (17). http://developer.android.com/sdk/index.html#download

Open the SDK Manager, click obsolete (so API 9 shows up), and grab API 9. This is really something that seems like a simple oversight and should be fixed.

3
  • This should be the top answer. Nov 18, 2014 at 13:12
  • All this time this was the issue. Thanks! Jan 9, 2015 at 23:13
  • Ensure that you can see API 9. I've added a note to the original article to show how.
    – Andrew S
    Jul 21, 2015 at 21:43
5

I had this problem show up after installing the latest updates using the ADT.

In eclipse I've got my project and a project for the google-play-services_lib.

I found that if you change the minimum sdk version (as said earlier) to greater than 9 it's not enough. I also had to change the "Project build target" (Properties/Android/) to match the version that I'd set in the manifest.

1
  • Yeah, safest bet is just to download android-9, as described above. Nov 18, 2014 at 13:14
3

just check the 'Obsolete' on SDK manager then install missing (API 9)

2

its the mnimum sdk version in ur manifest its should be more than version 9

1
  • 3
    I believe that he is referring to the minimum SDK that is defined in google-play-services_lib and not his personal project. Google is setting it to 9 by default. Jun 8, 2014 at 20:31
2

I fixed the project properties setting the project build target:

enter image description here

That works for me.

2

Two options to fix this:

1) install Android 2.3.1 (API 9), but is currently obsolete.

enter image description here

2) Change into the AndroidManifest.xml to at least android:minSdkVersion="10"

1

Change android:minSdkVersion="9" to more than 9 in AndroidManifest.xml file
i.e., android:minSdkVersion="10"
By doing this i solved my problem
Hope this helps!!

0

This may occur while you update the ADT. It could be because of the google play service libraries out of sync files. Simply closing the library and importing again will solve the out of sync issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.