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

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

我知道这个问题之前已经被问过好几次了,但我正在寻找其他类型的答案。

我只想运行一个项目,它给我这个错误。

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>

我查看了我的 Android sdk 管理器,是的。我没有android 14.

然后我试图找到引用 Andoid 14 的项目部分。但是我什么也没找到。

这是我的清单

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

那么哪一部分或哪一行真正要求 Android 14?

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

它将在 Eclipse 项目中的 project.properties 文件中,或者在 Android Studio 项目中模块的 build.gradle 文件 (compileSdkVersion) 中。

面对同样的问题,我找到了属性“compileSkdVersion”,它在 proguard.cfg[=17= 中包含对 v.14 的引用](Gradle 脚本,假设您使用的是 Android Studio 1.4)。

更改为“23”(今天最新版本),错误消失。

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

我在将 openCV 库导入 Android Studio 时遇到了这个问题。

事实证明,我只需要手动编辑 build.gradle 的 openCV 库以匹配您自己的项目。

我遇到了同样的问题。

我的工作是:

  • 在记事本++中打开build.gradle。
  • 将属性 "compileSdkVersion" 从 "Google Inc.:Google APIs:14" 更改为“14”
  • 打开 Android Studio 并重建项目。

您需要将project.propertiestarget=android-14”中的目标数量替换为您android工作室中可用的androidapi级别。您可以在 SDK 管理器上看到它。

示例,如果您有 api 级别 22 可用,您需要输入“target=android-22” =13=]

这是解决方案 打开 build.gradle 你会发现

compileSdkVersion 8

改成android6版本如下图

compileSdkVersion 23

您可以在 'build.gradle'

中找到这些属性
// Compilation configuration.
minSdkVersion = 13
compileSdkVersion = 14
targetSdkVersion = 14
buildToolsVersion = "14.0.0"

您可以更改为安装 SDK 版本或为您的 IDE 添加 SDK 版本