targetSdkVersion is used to specify the target Android version (API level) of the application, the default value is 28 (ie Android9.0).

  • HBuilderX3.2.13 cloud package adjustment targetSdkVersion default value is 28
  • HBuilderX cloud package targetSdkVersion default value is 26

Setting the targetSdkVersion value indicates the Android version (API level) that the app is adapted to. Setting a lower version of targetSdkVersion will make the APP run in compatibility mode, so it may not be able to use the features of the new system, and even running in compatibility mode may have security vulnerabilities and other issues . With the upgrade of the Android system, some application markets will require a higher targetSdkVersion to be submitted, which can be configured in the manifest.json of the project in HBuilderX.

️注意:

  • App升级时 targetSdkVersion 只能增加不能降低,也就是说 targetSdkVersion 高的App无法被 targetSdkVersion 低的App覆盖安装,开发者需要注意!
  • android 15 设备对 targetSdkVersion 版本有要求,低于24无法正常在android 15设备上正常安装,开发者需要注意!

# Set targetSdkVersion

The targetSdkVersion value is of type Number and must be a positive integer. For the range of values, refer to API level in Android version list.

Visual interface configuration

Source view configuration Open the manifest.json file of the project, switch to the "source view", and configure it according to the project type.

  • uni-app project Configure the targetSdkVersion attribute of the "app-plus" -> "distribute" -> "android" node, the example is as follows:
  "app-plus": {
    "distribute": {
      "android":{
        "targetSdkVersion": 30
      }
    }
  }
  • 5+App/Wap2App project items Configure the targetSdkVersion attribute of the "plus" -> "distribute" -> "google" node, the example is as follows:
  "plus": {
    "distribute": {
      "google":{
        "targetSdkVersion": 30
      }
    }
  }

Note: After configuring targetSdkVersion, save and submit the App cloud package to take effect

# Android version list

The corresponding list of API levels and Android versions is as follows:

API等级 Android版本号 Android版本名称
36 Android16 Android W
35 Android15 Android V, Vanilla Ice Cream
34 Android14 Android U, Upside Down Cake
33 Android13 Android T, Tiramisu
32 Android12L Android Sv2
31 Android12 Android S, Snow Cone
30 Android11 Android R, Red Velvet Cake
29 Android10 Android Q, Quince Tart
28 Android9 Android P, Pie
27 Android8.1 Android O_MR1
26 Android8.0 Android O, Oreo
25 Android7.1 Android N_MR1
24 Android7.0 Android N, Nougat
23 Android6.0 Android M, Marshmallow
22 Android5.1 Android L_MR1
21 Android5.0 Android L, Lollipop
20 Android4.4W Kitkat Watch
19 Android4.4 Kitkat