Home > Enterprise >  Difference between minCompileSdk and compileSdk
Difference between minCompileSdk and compileSdk

Time:06-16

Looking at this release note for AppCompat, there is now a minCompileSdk I wonder what is the difference of this from compileSdk

CodePudding user response:

As per the Gradle API's AAR documentation:

minCompileSdk: Minimum compileSdkVersion needed to consume this library. This is the minimum sdk version a module must use in order to import this library.

So a library can embed what SDK version it requires in order to work. For example, if AppCompat depends on API 33 APIs, your app must also compile with API 33 to work (otherwise those APIs that AppCompat is attempting to use don't exist when compiling your app, which would cause AGP and ProGuard to fail).

Therefore there aren't just differences - they're two entirely different sides of the same coin. minCompileSdk is something a library enforces on apps, while compileSdkVersion is something your app sets itself.

  • Related