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

五迷三道 提交于 2019-12-10 00:58:59

问题


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?


回答1:


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'
        }
    }
}



回答2:


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

compileSdkVersion 8

change it to android 6 version as shown below

compileSdkVersion 23



回答3:


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"




回答4:


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.




回答5:


you can find those properties in 'build.gradle'

// Compilation configuration.
minSdkVersion = 13
compileSdkVersion = 14
targetSdkVersion = 14
buildToolsVersion = "14.0.0"

You can change to install SDK version or add SDK version for your IDE




回答6:


I'm facing the same issue.

What I did to work was:

  • Open de build.gradle in notepad++.
  • Change the attr "compileSdkVersion" from "Google Inc.:Google APIs:14" to "14"
  • Open de Android Studio and rebuild de project.



回答7:


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

It would be in your project.properties file in an Eclipse project, or your module's build.gradle file (compileSdkVersion) in an Android Studio project.



来源:https://stackoverflow.com/questions/32416498/error-failed-to-find-target-with-hash-string-android-14-inopen-android-sdk-m

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!