来自文章https://developer.android.com/distribute/best-practices/develop/target-sdk ,
Google Play 将要求新应用从 2018 年 8 月 1 日起至少以 Android 8.0(API 级别 26)为目标,并且应用更新从 2018 年 11 月 1 日起以 Android 8.0 为目标。
以下代码来 self 的应用。
1:是不是说targetSdkVersion必须大于等于26?
2:是不是说minSdkVersion可以是21?
代码
defaultConfig {
applicationId "info.dodata.mirror"
minSdkVersion 21
targetSdkVersion 26
versionCode 9
versionName "1.09"
archivesBaseName = "My-V" + versionName
}
最佳答案
1: Does it mean that targetSdkVersion must be greater than or equal to 26 ?
是的。
2: Does it mean that minSdkVersion can be 21 ?
是的。 (或您需要支持的任何较低版本)
来自documentation :
android:minSdkVersion
An integer designating the minimum API Level required for the application to run. The Android system will prevent the user from installing the application if the system's API Level is lower than the value specified in this attribute. You should always declare this attribute.
android:targetSdkVersion
An integer designating the API Level that the application targets. If not set, the default value equals that given to minSdkVersion. This attribute informs the system that you have tested against the target version and the system should not enable any compatibility behaviors to maintain your app's forward-compatibility with the target version. The application is still able to run on older versions (down to minSdkVersion).
关于android - Google Play 的目标 API 级别要求的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52233892/