Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error : cause android.compileSdkVersion is missing

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')
    }
}

enter image description here

enter image description here

like image 243
N Sharma Avatar asked Mar 12 '14 05:03

N Sharma


People also ask

What is the compileSdkVersion?

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.

What does targetSdkVersion mean?

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.


Video Answer


1 Answers

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

like image 175
codezjx Avatar answered Sep 17 '22 14:09

codezjx