This article will tell you everything you need to know to deal with all those crazy version rules. Everything will come with source (a.k.a. answers on StackOverflow) if necessary.
- minSdkVersion ≤ targetSdkVersion (dah)
- targetSdkVersion ≤ compileSdkVersion
- support libraries version = compileSdkVersion
- compileSdkVersion ≤ buildToolsVersion
- support libraries version ≤ buildToolsVersion (by combining no. 3 and no. 4)
- click and scroll down to see the mapping between Gradle Plugin version and Gradle version
- minSdkVersion ≤ targetSdkVersion = support libraries version = compileSdkVersion ≤ buildToolsVersion
- Android Gradle Plugin depends on the Gradle version
- even though targetSdkVersion can be older than support libraries version & compileSdkVersion, it does not seems to be recommended, but I don’t know if there is anything that might break. If you have any experience/example/etc, let me know and I will update this document.
- the use of maxSdkVersion is generally discouraged
- Gradle Plugin nor Gradle depends on Android Studio version from what I can see, but they generally comes together, and if you upgrade to a newer version of Android Studio it will usually ask if you want to upgrade The Gradle Plugin to the newer version.