10

I have the latest ADT plugin for eclipse: ADT-23.0.4.
Eclipse Version: Luna Service Release 1 (4.4.1).

Still I am getting this error while importing a project:

Unable to resolve target 'android-21'

Zero
  • 357
  • 2
  • 5
  • 20
  • check with this 2 answers : [Answer 1](http://stackoverflow.com/questions/26623083/got-an-error-while-building-a-project-in-new-workspace/26993815#26993815) [Answer 2](http://stackoverflow.com/questions/26989567/android-eclipse-importing-old-project-shows-error-on-android-l-5-0) – krishnan muthiah pillai Dec 24 '14 at 13:17
  • 1
    https://code.google.com/p/android/issues/detail?id=73415 – Jim In Texas Feb 02 '15 at 15:34

2 Answers2

13

Right Click on Project -> Properties -> android -> choose your target api level you have, Then press Apply and Ok

And clean the project once and rebuild it.

balaji koduri
  • 1,321
  • 9
  • 25
Rathan Kumar
  • 2,567
  • 2
  • 17
  • 24
  • tried it.....got these errors: "The connection to adb is down, and a severe error has occured." "You must restart adb and Eclipse." and "Please ensure that adb is correctly located at *D:\..\adb.exe*" – Zero Dec 24 '14 at 12:23
7

Go to Windows -> Android SDK Manager Install the Android API Level you want, in this case 21.

Once you've finished installing, go to Window -> Preference -> Android. You should get a list of available targets. Click Apply then Ok.

Now right click your project, go to properties. Click Android. Choose your desired target.

Rahul Mane
  • 1,005
  • 18
  • 33