【发布时间】:2016-01-24 16:18:44
【问题描述】:
我想将我的 compileSdkVersion 从 23 更改为 21。所以我在 build.gradle 中进行了以下更改,但出现以下错误。我该如何解决这个问题?
找不到带有哈希字符串“android-21”的目标
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.shalabh.fly"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.0.1'
compile files('libs/httpclient-4.1-beta1.jar')
}
【问题讨论】:
-
你确实下载了它,不是吗?
-
是的,我已经下载了sdk21
-
Android Studio 是否给出了一些关于缺少什么的提示?
-
你能检查一下你的android安装的sdk/platforms/路径下是否有名为android-21的文件夹。
-
如果您还没有安装 android-21 平台工具,请尝试重新安装。
标签: android gradle android-gradle-plugin build.gradle android-appcompat