failed to find target with hash string 'android-22'
Solution 1:
Just click on the link written in the error:
Open Android SDK Manager
and it will show you the dialogs that will help you to install the required sdk for your project.
Solution 2:
Open the Android SDK Manager
and Update with latest :
- Android SDK Tools
- Android SDK Build Tools
Then Sync ,Re-Build and Restart Your Project
Demo Code for build.gradle
compileSdkVersion 21 // Now 23
buildToolsVersion '21.1.2' //Now 23.0.1
defaultConfig
{
minSdkVersion 15
targetSdkVersion 19
}
Hope this helps .
Solution 3:
Okay you must try this guys it works for me:
- Open SDK Manager and Install SDK build tools 22.0.1
- Sync gradle That'all
Solution 4:
I modified build.gradle compileSdkVersion to 23 from 22 and targetSdkVersion to 23 from 22.
My API level was 23. I had to update the API version to 23 as well.
I had to import my project from Eclipse to Android Studio. It worked for me.