Updated on 2024-05-30 GMT+08:00

Building with Android

The Android build system compiles application resources and source code, and then packages them into APKs that can be deployed, signed, and distributed.

Custom Installation

sdkmanager command (sdkmanager packages [options]): installs the required Android build environment. For example, sdkmanager "platform-tools" "platforms;android-28" --sdk_root=./ indicates that sdkmanager is used to download platform-tools and platforms;android-28 to the root directory of the current code.

Configuration Description

Add Build with Android, when configuring build actions.

The parameters are described in the following table.

Parameter

Description

Action Name

Name of a build action. It can be customized.

Gradle

Select a Gradle version.

JDK

Select a JDK version.

NDK

Select an NDK version as required. You can also select No.

Commands

Configure the Gradle commands. You can also use default commands.

Android Version Description

  • SDK: used to specify compileSdkVersion.
  • Build Tools: used to specify buildToolsVersion.

You can find the two versions in the build.gradle file or the global configuration file (user-defined) of the project.

  • Select compileSdkVersion or buildToolsVersion based on project requirements.
  • The Gradle wrapper build mode is also supported. If the provided Gradle version does not meet your requirements, you can run the gradlew command for build using the wrapper. The required Gradle version will be automatically downloaded. Example of the build command: ./gradlew clean build.