Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: failed to find target with hash string 'android-14' in:Open Android SDK Manager

Tags:

android

sdk

I know this question has been asked several times before this, but i am looking for some other kind of answer.

I just want to run a project, and it gives me this error.

Error:A problem occurred configuring project ':app'.
> failed to find target with hash string 'android-14' in: C:\Users\etc.
<a href="openAndroidSdkManager">Open Android SDK Manager</a>

I took a look at my Android sdk manager, and yes. I do not have android 14.

Then I tried to find the part of project which refrences the Andoid 14. But i found nothing.

Here is my manifest

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" />
<application android:label="@string/app_name"
             android:icon="@drawable/ic_launcher">

So which part or line really ask for Android 14?

like image 589
Sal-laS Avatar asked Sep 05 '15 18:09

Sal-laS


4 Answers

Facing the same issue, I have found atribute "compileSkdVersion" which holds the reference to v.14 in proguard.cfg (Graddle Scripts, assuming you are using Android Studio 1.4).

Changed to "23" (latest today version), error went gone.

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.example.android.lifecycle"
        minSdkVersion 7
        targetSdkVersion 15
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}
like image 123
fabrosell Avatar answered Nov 11 '22 01:11

fabrosell


here is the solution open build.gradle there you will find

compileSdkVersion 8

enter image description here

change it to android 6 version as shown below

compileSdkVersion 23
like image 33
dinu1389 Avatar answered Nov 11 '22 01:11

dinu1389


You need to replace the number of target into project.properties "target=android-14" to your available android api level in your android studio. You can see that on SDK Manager.

Example, if you have api level 22 available you need to put "target=android-22"

like image 3
Federico Aineseder Avatar answered Nov 11 '22 01:11

Federico Aineseder


I had this issue when I imported openCV library into Android Studio.

It turns out I just need to manually edit the build.gradle for the openCV library to match your own project.

like image 2
paradite Avatar answered Nov 11 '22 03:11

paradite