android - 错误 :Failed to find target with hash string 'android-24' in:

标签 android

你好吗? 我是新手,很像android,但是在创建项目的时候遇到了困难。 我用的编译工具是android studio 2.2 Preview5。 创建项目后,发现错误。

Error:Failed to find target with hash string 'android-24' in: E:\android-sdk-windows
<a href="install.android.platform">Install missing platform(s) and sync                project</a>

buid.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "22.0.0"
    defaultConfig {
        applicationId "www.jike.com.myapplication"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:24.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'
    testCompile 'junit:junit:4.12'
}

因为是自学,所以没有人可以引用。 在stackoverflow中,我发现了一个类似的问题,但是我不太了解。

我是新手不懂,希望 friend 们详细解释,非常感谢。

本人英文不好,以上文字是用软件翻译的,用词不够准确,请见谅。

希望得到帮助。再次感谢。

最佳答案

Error:Failed to find target with hash string 'android-24'

打开 SDK 管理器并检查更新

你可以使用

compileSdkVersion 23
buildToolsVersion "24.0.0"

并设置

  1. targetSdkVersion 23

  2. 编译 'com.android.support:appcompat-v7:23.4.0'

最后,Clean-RebuildRun

关于android - 错误 :Failed to find target with hash string 'android-24' in:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38455630/

相关文章:

java - API 'variant.getJavaCompile()' 已过时

android - 如何在可搜索微调器中使用 SearchView.OnQueryTextListener()?

java - Android:虚拟显示器和真实电话问题

Android模拟器Jenkins插件不起作用

android - 调用 "Choose screen lock"屏幕的 Intent 是什么?

android - Xamarin WebView 项目中的 Intellisense 错误

android - 在 SDK 上从 'getLastKnownLocation' 获取 null

android - Android 上的 NotImplementedException

android - 获取单选按钮值 Android

android - 是安卓:animateLayoutChanges supposed to work when a child view's height is updated?