错误:导致 android.compileSdkVersion 丢失 [英] Error : cause android.compileSdkVersion is missing
问题描述
我最近开始在 Android Studio 上工作.当我与 gradle 同步时,它给了我一个错误.
I am recently started to work on the Android Studio. When I am doing sync with gradle then it is giving me a error .
错误:原因:缺少 android.compileSdkVersion!
Error : Cause: android.compileSdkVersion is missing!
伙计们,这可能是什么原因,我已经安装了相同的 compileSDKVersion 和构建工具.我看到很多帖子说要确认您的系统中安装了相同的 sdk 版本,但在我的情况下它已经安装.
Guys what could be reason for this, I already have same compileSDKVersion and build tool installed. I see many threads that saying to confirm that you have same sdk version installed in your system but in my case it is already installed.
build.gradle
build.gradle
android {
compileSdkVersion 19
buildToolsVersion "19.0.1"
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
sourceSets {
instrumentTest.setRoot('src/test')
}
}
推荐答案
我也遇到了这个问题,不知道我的方案是否适合你.我只是改变了这个脚本的位置:apply from: 'maven_push.gradle'
到 build.gradle 文件的底部,然后构建成功!
I met this problem too, but I don't know whether my solution suit for you.
I just change the position of this script: apply from: 'maven_push.gradle'
to the bottom in build.gradle file, and BUILD SUCCESSFUL!
我在这里发布我的答案,你可以试试.:在 Jenkins 上构建 Android Studio 项目?android.compileSdkVersion 缺失
I post my answer here, you can try it.: Building Android Studio project on Jenkins? android.compileSdkVersion is missing
这篇关于错误:导致 android.compileSdkVersion 丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!