【问题标题】:Android Studio 0.5.3 android.compileSdkVersion is missing缺少 Android Studio 0.5.3 android.compileSdkVersion
【发布时间】:2014-04-07 10:46:17
【问题描述】:

我使用的是 Android Studio 0.5.3

我不断得到:

Gradle 'OpenBook' 项目刷新失败: 原因:缺少android.compileSdkVersion! 摇篮设置

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.9.+'
    }
}
apply plugin: 'android'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.3"

    defaultConfig {
        minSdkVersion 9
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
    }

    sourceSets {
        main {
            manifest.srcFile '/MyApp/src/main/AndroidManifest.xml'
        }
    }
}

还有我的 App Buid.gradle

apply plugin: 'android'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.3"

    defaultConfig {
        minSdkVersion 9
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
    }

    sourceSets {
        main {
            manifest.srcFile '/src/main/AndroidManifest.xml'
        }
    }
}



dependencies {
//    compile 'com.android.support:appcompat-v7:+'
    compile project("libraries:library-toast")
    compile project("libraries:Volley")
    compile project("libraries:actionbarsherlock")
    compile project("libraries:Dialoglibrary")
    compile project("libraries:google-play-services_lib")
    compile project("libraries:PullToRefreshlibrary")
    compile project("libraries:facebook")
    compile project("libraries:SlidingTabBarlibrary")
    compile project("libraries:AndroidPlot-Core")
    compile project("libraries:SignUpModule")
    compile project("libraries:Jars")
    compile project("libraries:UpdateChecker")
    compile "com.mixpanel.android:mixpanel-android:4.0.0@aar"
}

不知道该怎么做。 感谢您的帮助

【问题讨论】:

    标签: android gradle android-studio android-gradle-plugin build.gradle


    【解决方案1】:

    您在构建文件中指定了“compileSdkVersion 19”。似乎您缺少该 SDK(您可以发布更多带有错误的输出)您需要确保使用 Android Studio 中的 SDK 管理器安装了正确的 SDK。

    Jake Wharton 创建了一个新的 gradle 插件来自动更新 SDK https://github.com/JakeWharton/sdk-manager-plugin

    【讨论】:

      猜你喜欢
      • 2015-08-11
      • 1970-01-01
      • 1970-01-01
      • 2018-04-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-10
      相关资源
      最近更新 更多