I am recently started to work on the Android Studio. When I am doing sync with gradle then it is giving me a error .
Error : Cause: android.compileSdkVersion is missing!
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
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')
}
}
The compileSdkVersion is the version of the API the app is compiled against. This means you can use Android API features included in that version of the API (as well as all previous versions, obviously). If you try and use API 16 features but set compileSdkVersion to 15, you will get a compilation error.
The target sdk version is the version of Android that your app was created to run on. The compile sdk version is the the version of Android that the build tools uses to compile and build the application in order to release, run, or debug. Usually the compile sdk version and the target sdk version are the same.
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!
I post my answer here, you can try it.: Building Android Studio project on Jenkins? android.compileSdkVersion is missing
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With