0

What will happened if I implement CompileSDK < targetSDK?

Starting in November 2021, app updates will be required to target API level 30. Can I have targetSDK 30 and compileSDK 29 on my app?

aliftc12
  • 172
  • 10
  • Does this answer your question? [What is the difference between compileSdkVersion and targetSdkVersion?](https://stackoverflow.com/questions/26694108/what-is-the-difference-between-compilesdkversion-and-targetsdkversion) – Bishan Apr 07 '21 at 02:44
  • @Bishan I know everyone said CompileSDK should be greater or equal targetSDK. But I still confuse what will happened if CompileSDK < targetSDK. Because I still able to build the app with CompileSDK < targetSDK. – aliftc12 Apr 07 '21 at 02:55

2 Answers2

0

App will run correctly. As there is no relation between the CompileSdkVersion and targetSdkVersion.

compileSdkVersion is your way to tell Gradle what version of the Android SDK to compile your app with. Using the new Android SDK is a requirement to use any of the new APIs added in that level.

tagetSdkVersion is used to indicate the version that out app tested and working fine. Having the latest targetSdkversion increases the User Experience, Security and Performance of the application and still allow app to run on older version.

According to Documentation you should compile your application against the lowest possible version of the platform that your application can support.

Hence, there is no problem in having compileSdkVersion<targetSdVersion.

GaneshHulyal
  • 86
  • 1
  • 4
0

Compile SDK version: The compile SDK version, or build target, specifies which version to use when building your own code. When building, compiler and builder will use it to find the classes and methods you refer to in your imports. So, the build target(compile SDK version) determines which SDK version it checks against when compiling.

Target SDK version: Each android release comes with some design & behavior changes. Increasing the target SDK when a new version of Android is released makes your app run with the appearance and behavior of the latest version when it runs on such a device.

To clear the confusion, let's take a scenario: Let's say Android released a new SDK version 99 with a new video player API and changed the touch animation of all buttons.

  • In your scenario, compileSdkVersion<targetSdkCersion, If you keep the compiler SDK version less than 99, you won't be able to take advantage of the new video player API in your code. But, keeping target SDK equal to 99, your app will take advantage of the new touch animation of all buttons because it is provided by the OS.

That's why the minimum and target SDK versions are placed in the manifest when you build your app, in order to advertise those values to the OS.

Pankaj Sati
  • 2,441
  • 1
  • 14
  • 21