What is the difference between compileSdkVersion and targetSdkVersion ?
- Here is exactly the same question. You can sometimes search before writing. stackoverflow.com/questions/26694108/β¦ - dubok79
- 2@ dubok79 I saw this answer, but did not fully understand it. So I decided to ask a question here. - iamtihonov
1 answer
I will slightly supplement the initial answer (by reference from the comment @ dubok79) + I will try to explain on the fingers.
compileSdkVersion is the SDK version from which builds will be built. By and large, affects all sorts of debugging messages. Of course, the SDK itself is not "sewn up" in the final build; moreover, there will not even be a mention of this setting in it.
Personally, I try to keep it equal to targetSdkVersion . In theory, the following situation is possible, for example (purely fictional, but the logic should be clear). With the new SDK version, several methods have become deprecated. If we increase the value of the parameter, we will receive warnings when building the project. However, at the moment, the team needs to urgently make a new functional, it will only be possible to get rid of the outdated upon completion. Then it is better not to raise, so that among the ignored warnings, do not miss important ones.
targetSdkVersion is the maximum version for which you tested your application. This is needed by Android in order to understand whether it is possible to use the latest functionality in the application or it may not be ready for it. It helps to avoid situations where default values ββ/ behavior have changed with updating the axis version, from which your application may start to work worse. An example that comes to mind: when the mandatory menu buttons removed and replaced with ActionBar.
Again, in my case I try to keep this parameter always relevant to the latest version of the axis. But the transition - it is always necessary to check if something has broken, to run comprehensively through the application. Therefore, it is not always done immediately and quickly.
- "there won't even be any mention of this setting." - who told you that? Decompile any apk from the store and see all these values ββin the manifest: platformBuildVersionCode = "25"
- oneI do not see discrepancies in your example: I wrote about the absence of compileSdkVersion, you have minSdkVersion and targetSdkVersion. - kpower