gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 14:47:20 25 4
gpt4 key购买 nike

你好吗?我是新手,很像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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com