你好吗? 我是新手,很像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"
并设置
targetSdkVersion 23
编译 'com.android.support:appcompat-v7:23.4.0'
最后,Clean-Rebuild
和Run。
关于android - 错误 :Failed to find target with hash string 'android-24' in:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38455630/