Android: Configuring targetSdkVersion

View Markdown

Last edited on 2026-07-17

targetSdkVersion is used to specify the target Android version (API level) for an application. Setting a value for targetSdkVersion indicates which Android version (API level) the app is adapted for. If the platform's API level is higher than the version declared by the app's targetSdkVersion, the system can enable compatibility behaviors. Therefore, setting a lower targetSdkVersion causes the APP to run in compatibility mode, which may prevent the use of new system features. Running in compatibility mode may also lead to security vulnerabilities and other issues. Developers should therefore configure this value with caution.

Note

  1. For multi-platform applications, the default targetSdkVersion in Developer Tools is 29. The minimum value that can be set is also 29 (i.e., developers can set values ≥ 29; some application stores require a higher targetSdkVersion for submission, so developers should set it according to the specific requirements of the application store when submitting for review).

  2. When upgrading an App, targetSdkVersion can only be increased, not decreased. This means an App with a higher targetSdkVersion cannot be overwritten by an App with a lower targetSdkVersion during installation.

  3. The targetSdkVersion value must be of the Number type and must be a positive integer. For the valid range, refer to the API levels listed in the Android version table below.

I. targetSdkVersion Configuration Guide

Upgrade the Developer Tools to the latest nightly version, switch to Multi-Platform Mode, and click project.miniapp.json. Locate "Other Common Settings" under the Android section. You can refer to the image below to configure targetSdkVersion.

  • After configuration, you must rebuild the APK for the changes to take effect.
  • minSdkVersion is used to configure the integer representing the minimum API level required for the app to run. If the system's API level is lower than the value specified in this attribute, the Android system will prevent users from installing the app. The default value is 21. Please do not enter a value lower than 21.

II. API Level and Android Version Mapping

For more details, see the official documentation: https://developer.android.com/guide/topics/manifest/uses-sdk-element?hl=zh-cn

| Android 4.1, 4.1.1 | 16 | | Android 4.0.3, 4.0.4 | 15 | | Android 4.0, 4.0.1, 4.0.2 | 14 | | Android 3.2 | 13 | | Android 3.1.x | 12 | | Android 3.0.x | 11 | | Android 2.3.4, 2.3.3 | 10 | | Android 2.3.2, 2.3.1, 2.3 | 9 | | Android 2.2.x | 8 | | Android 2.1.x | 7 | | Android 2.0.1 | 6 | | Android 2.0 | 5 | | Android 1.6 | 4 | | Android 1.5 | 3 | | Android 1.1 | 2 |
| Android 1.0 | 1 |