I\'ve always programmed Android with Eclipse and decided to start migrating to Android Studio. I decided to use the same SDK I already had for Eclipse, then:
As others have already mentioned your compile sdk version
must match your support library's
major version. This is however, also relevant for subprojects
should you have any.
In case you do, you can set your subprojects
compile sdk versions with the following script:
subprojects { subproject ->
afterEvaluate{
if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
}
}
}
}
Add this script in your root build.gradle
file.