Android studio Error: failed to find target with hash string 'android-21'

Started by
7 comments, last by grumpyOldDude 8 years, 5 months ago

Hello

Migrating my project from eclipse to Android Studio I am having this error:

Error:Cause: failed to find target with hash string 'android-21'
I did "Open Android SDK Manager" and installed all latest and relevant updates but error persisted
I am really stuck, Does anyone know what I have to do to Android Studio to find 'andriod-21'?

Any help appreciated

can't help being grumpy...

Just need to let some steam out, so my head doesn't explode...

Advertisement

Moving to Mobile forum in the hopes of getting more relevant eyeballs.

Your message is a little unclear. Is this an issue with Eclipse and its little hints? Or is this an issue with compilation?

If it is a compilation issue, please give the full error message starting with the first one, and an exact copy/paste of the code mentioned in the error.

Still stuck with same problem on Android Studio build....

Error:A problem occurred configuring project ':app'.
> failed to find target with hash string 'android-21'
BUILD FAILED
EDIT: Looks conclusive now that even GD.net gurus don't know, so Android Studio really really sucksangry.png , I'm sticking with eclipse

can't help being grumpy...

Just need to let some steam out, so my head doesn't explode...

In Android Studio, did you try look in Preferences, under Apperance & Behaviour -> System Settings -> Android SDK ?

There you can choose to download specific API versions, make sure Android 5.0 (21) is downloaded...

Even if you have the latest SDK, you might not have the specific API version downloaded.

You can also change which API version it tries to look for with "compileSDKVersion" in your build.gradle, or if it was targetSDKVersion, don't remember. (I gave up on AS some months ago and am using Eclipse now, but it was for NDK reasons, I think AS should be ok for java dev)

Many thanks for reply

when i read this, I've been checking the AS menus and sub-menus all over to find Appearance and behaviour all over but couldn't. I sometimes miss things so 've been double checking but still couldn't find it. Could let me know the menu/submenu you are refering to.

Lots of Thanks

[attachment=29565:AS.png]

can't help being grumpy...

Just need to let some steam out, so my head doesn't explode...

I'm on OSX, and have an extra menu to the left of "File" which has a "Preferences..." in it.

I'm not sure where "Preferences..." is on windows, maybe under "File"?

I seem to reach the same place if I also go to Tools->Android->SDK Manager

yea Tool->Android->SDK Manager

First time i'm viewing this..., 've been looking around AS sdk manager and its not too dissimilar to the SDK manager on eclipse.

I can see how this would help sync/update the API, many thanks you are a life-saver.

Though i've not fixed the problem yet, i'm hoping when i started again i should be able to fix.. Well maybe i shouldn't get too optimistic yet... The reason I had more issues was i only stuck to this instructions http://developer.android.com/sdk/installing/migrate.html thinking that would do it

Would you still be alright using Eclipse after this year since Google is no longer supporting eclipse beyong 2015?

can't help being grumpy...

Just need to let some steam out, so my head doesn't explode...


Would you still be alright using Eclipse after this year since Google is no longer supporting eclipse beyong 2015?

It seems to work about as well as ever for me.

The main problem is all the documentation is defaulted to Android Studio now, but I think most of the eclipse documentation is still there, just slightly harder to reach.

Currently I'm using NVidias android bundle, it comes with eclipse, android sdk, ndk, and also comes with some nice extra tools to measure performance and debug. (havn't used those much yet though, mostly been using Intel GPA to debug OpenGL)

https://developer.nvidia.com/CodeWorks-Android

Since you are using windows, you might be happy to know they also have visual studio plugins, but I haven't had the opportunity to try them, so I don't know what exactly you can do with them.

In Android Studio, did you try look in Preferences, under Apperance & Behaviour -> System Settings -> Android SDK ?
There you can choose to download specific API versions, make sure Android 5.0 (21) is downloaded...

Even if you have the latest SDK, you might not have the specific API version downloaded.

You can also change which API version it tries to look for with "compileSDKVersion" in your build.gradle, or if it was targetSDKVersion, don't remember. (I gave up on AS some months ago and am using Eclipse now, but it was for NDK reasons, I think AS should be ok for java dev)

Many thanks Olof, Android studio is working, original issue is fix, though but my main project output seems weird. (working on that) THANKS

can't help being grumpy...

Just need to let some steam out, so my head doesn't explode...

This topic is closed to new replies.

Advertisement