Search code examples
androidandroid-gradle-pluginandroid-build

Does changing the compileSdkVersion affect the behavior of the app at runtime?


So I know that compileSdkVersion is the version of the API the app is compiled against. While targetSdkVersion is the version the app was tested against.

I am using a library which requires some attributes present in a higher API version for which I need to update the compileSdkVersion else I get build errors. But I don't want to update the version of the support libraries or the targetSdkVersion. Will this have an impact on how the other features of the app behave? Can I expect to release the app with surety that other features won't break?


Solution

  • Will this have an impact on how the other features of the app behave?

    It could only impact on a library, which wants higher API. At runtime you could check version API and skip some operations, but your case inside a box (lib), no way. However, some of classes could be deprecated or even erased in the next releases of android support library.

    Iak Lake wrote a good topic about compileSdkVersion vs minSdkVersion vs targetSdkVersion. Here is a link.