Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android error in eclipse: Unable to resolve target 'android-xx'

I know there are some sort-of duplicates of this, but none of the answers have been able to help me so far.

In a project shared with some friends over SVN, I always get the following error:

Unable to resolve target 'android-10'

When I change project.properties to alter the target version, the error message will remain, unless I use android-16.

I have checked my project's Android sessions to see if I could change the target there, but it only gives me 16 and 17 as options.

In my SDK Manager, I have the entire "SDK 10" branch installed, as well as several others.

Does anybody know what may be the problem here?

like image 811
Neko Avatar asked Feb 17 '13 20:02

Neko


3 Answers

Another method is not use the same SDK, but use the SDK in your computer.

  1. Right click project and select Android ,check target name, click 'apply' and 'ok'.
  2. Then Right click project -> Android Tools -> Fix Project Properties.
  3. Clean and build the project.

set property add sdk

like image 107
christophe Avatar answered Nov 11 '22 13:11

christophe


This answer is way too late but for anyone experiencing the same problem, try installing API 10 from the SDK Manager. Then run everything as you did before.

Or if you're on a Windows OS, this might also help: http://sagistech.blogspot.ca/2010/05/android-sdk-error-unable-to-resolve.html

like image 35
starcodex Avatar answered Nov 11 '22 12:11

starcodex


If you're not getting android-10 as an option in the properties view, then clearly there is something wrong with your installation.

Well, the obvious thing to do is to doublecheck that the SDK location in Window >> Preferences >> Android is set up correctly and pointing to the right installation of the ADT. If so, the view in preferences should also include SDK10 as one of the installed platforms (in which case, there really shouldn't be any problem).

If it doesn't, something has gone wrong - either in Eclipse or the ADT installation. I would check - just to be sure - that you have the right Java SDK - I've had problems with Eclipse/ADT myself when this is the case.

If those two things seem in order, though, the best advice I can give is to reinstall eclipse and the ADT both. If you only use the installation for Android, then I'd suggest using the "official" Google Eclipse package from developers.android.com.

Unless you have a lot of stuff set up in your eclipse environment that would be pain to change, I wouldn't recommend spending time on trying to identify whatever variable is messed up (speaking from painful experience here ;) ).

like image 4
Michael A. Avatar answered Nov 11 '22 13:11

Michael A.