错误:无法使用哈希字符串'android-21'找到目标

use*_*461 12 android android-appcompat gradle build.gradle android-gradle-plugin

我想将我的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')
    }
Run Code Online (Sandbox Code Playgroud)

Gab*_*tti 3

您正在使用

 compile 'com.android.support:appcompat-v7:23.0.1'
Run Code Online (Sandbox Code Playgroud)

所以你必须使用 API 23 进行编译。在你的文件中
更改你的compileSdkVersionbuild.gradle

 compileSdkVersion 23
Run Code Online (Sandbox Code Playgroud)