Environment configuration for the component-based method

更新时间:
复制 MD 格式

Set up your development environment on Windows, macOS, or Linux before building client applications with the mPaaS component-based method.

Before you start development, configure the environment for your operating system:

Configure the Windows development environment

Complete the following steps to configure your Windows development environment.

Configure the Java 8 environment

The mPaaS framework requires Java Development Kit (JDK) 8 or later.

  1. Download and install JDK 8.

  2. Set the JAVA_HOME environment variable to your JDK installation path, then add %JAVA_HOME%\bin to the PATH environment variable.

  3. Verify the installation by running java -version. The output shows the installed JDK version: java_version_cmd.png

Configure the Gradle 4.4 environment

The mPaaS framework requires Gradle 4.4 exactly.

Use Gradle Wrapper (recommended)

Gradle Wrapper pins the Gradle version to your project, so other developers on the team get the same build environment without separate configuration.

  1. If your project already uses Gradle Wrapper, set the version to 4.4 in /gradle/wrapper/gradle.properties.

  2. If your project does not use Gradle Wrapper yet, make sure your global Gradle version is 4.4, then run gradle wrapper --gradle-version=4.4 to add a wrapper to the project. Build with ./gradlew going forward — this keeps changes to your local environment minimal.

Use standalone Gradle

  1. Download Gradle 4.4.

  2. Unzip the .zip package to your preferred location. Set GRADLE_HOME to that path, then add %GRADLE_HOME%\bin to the PATH environment variable.

  3. Verify the installation by running gradle -v. The output shows the Gradle version and build information: gradle_v_cmd.png

Install and configure Android Studio

Install Android Studio

The latest mPaaS plug-in requires Android Studio 4.0 or later.

  • Download Android Studio from Android Developers.

  • Follow the installation guide for Windows.

  • If you are upgrading from an earlier Android Studio version that had the mPaaS plug-in installed, upgrade the plug-in to the latest version after upgrading Android Studio to 4.0 or later. For details, see Update the mPaaS plug-in.

  • If you need the mPaaS plug-in for Android Studio versions earlier than 4.0, download the offline installation package and install it manually. For details, see Install the mPaaS plug-in offline.

Install the Android SDK

Install the Android SDKs for API level 19 and 26.

  1. In Android Studio, go to File > Settings to open the Settings dialog box.

  2. In the Android SDK section, select the SDKs for API level 19 and 26, then click Apply to install them. install_android_sdk

Install the mPaaS plug-in

For installation instructions, see Install the mPaaS plug-in.

Configure the Gradle build tool

Your project must use Gradle Wrapper for builds.

  1. In Android Studio, go to File > Settings to open the Settings dialog box.

  2. In the Gradle section, select Use default gradle wrapper and click Apply. gradle

Configure the macOS development environment

Complete the following steps to configure your macOS development environment.

Configure the Java 8 environment

The mPaaS framework requires JDK 8 or later.

  1. Download and install JDK 8.

  2. Set the JAVA_HOME environment variable to your JDK installation path, then add $JAVA_HOME/bin to the PATH environment variable.

  3. Verify the installation by running java -version. The output shows the installed JDK version: java_version_cmd.png

Configure the Gradle 4.4 environment

The mPaaS framework requires Gradle 4.4 exactly.

Use Gradle Wrapper (recommended)

Gradle Wrapper pins the Gradle version to your project, so other developers on the team get the same build environment without separate configuration.

  1. If your project already uses Gradle Wrapper, set the version to 4.4 in /gradle/wrapper/gradle.properties.

  2. If your project does not use Gradle Wrapper yet, make sure your global Gradle version is 4.4, then run gradle wrapper --gradle-version=4.4 to add a wrapper to the project. Build with ./gradlew going forward — this keeps changes to your local environment minimal.

Use standalone Gradle

  1. Download Gradle 4.4.

  2. Unzip the .zip package to your preferred location. Set GRADLE_HOME to that path, then add $GRADLE_HOME/bin to the PATH environment variable.

  3. Verify the installation by running gradle -v. The output shows the Gradle version and build information:

    macOS 信息截图

Install and configure Android Studio

Install Android Studio

The latest mPaaS plug-in requires Android Studio 4.0 or later.

  • Download Android Studio from Android Developers.

  • Follow the installation guide for macOS.

  • If you are upgrading from an earlier Android Studio version that had the mPaaS plug-in installed, upgrade the plug-in to the latest version after upgrading Android Studio to 4.0 or later. For details, see Update the mPaaS plug-in.

  • If you need the mPaaS plug-in for Android Studio versions earlier than 4.0, download the offline installation package and install it manually. For details, see Install the mPaaS plug-in offline.

Install the Android SDK

Install the Android SDKs for API level 19 and 26.

  1. In Android Studio, go to Android Studio > Preferences to open the Preferences dialog box.

  2. In the Android SDK section, select the SDKs for API level 19 and 26, then click Apply to install them. install_android_sdk

Install the mPaaS plug-in

For installation instructions, see Install the mPaaS plug-in.

Configure the Gradle build tool

Your project must use Gradle Wrapper for builds.

  1. In Android Studio, open any Android project.

  2. Open the Preferences dialog box.

  3. In the Gradle section, select Use default gradle wrapper and click Apply. use_gradle_wrapper.png

Configure the Linux development environment

These instructions cover CentOS and Ubuntu. Steps may vary for other Linux distributions.

Configure the Java 8 environment

The mPaaS framework requires JDK 8 or later.

  1. Download and install JDK 8.

  2. Set the JAVA_HOME environment variable to your JDK installation path, then add $JAVA_HOME/bin to the PATH environment variable.

  3. Verify the installation by running java -version. The output shows the installed JDK version: java_version_cmd.png

Configure the Gradle 4.4 environment

The mPaaS framework requires Gradle 4.4 exactly.

Use Gradle Wrapper (recommended)

Gradle Wrapper pins the Gradle version to your project, so other developers on the team get the same build environment without separate configuration.

  1. If your project already uses Gradle Wrapper, set the version to 4.4 in /gradle/wrapper/gradle.properties.

  2. If your project does not use Gradle Wrapper yet, make sure your global Gradle version is 4.4, then run gradle wrapper --gradle-version=4.4 to add a wrapper to the project. Build with ./gradlew going forward — this keeps changes to your local environment minimal.

Use standalone Gradle

  1. Download Gradle 4.4.

  2. Unzip the .zip package to your preferred location. Set GRADLE_HOME to that path, then add $GRADLE_HOME/bin to the PATH environment variable.

  3. Verify the installation by running gradle -v. The output shows the Gradle version and build information.

Install 32-bit compatibility libraries

CentOS 6, CentOS 7, and Ubuntu do not include the ia32-lib library by default. Install 32-bit compatibility libraries on all 64-bit Linux systems before installing Android Studio. For installation instructions, see android-sdk.

# Ubuntu
sudo apt-get install zlib1g:i386

# CentOS
yum install libstdc++.i686

Install and configure Android Studio

Install Android Studio

The latest mPaaS plug-in requires Android Studio 4.0 or later.

  • Download Android Studio from Android Developers.

  • Follow the installation guide for Linux.

  • If you are upgrading from an earlier Android Studio version that had the mPaaS plug-in installed, upgrade the plug-in to the latest version after upgrading Android Studio to 4.0 or later. For details, see Update the mPaaS plug-in.

  • If you need the mPaaS plug-in for Android Studio versions earlier than 4.0, download the offline installation package and install it manually. For details, see Install the mPaaS plug-in offline.

Install the Android SDK

Install the Android SDKs for API level 19 and 26.

  1. In Android Studio, go to File > Settings to open the Settings dialog box.

  2. In the Android SDK section, select the SDKs for API level 19 and 26, then click Apply to install them. install_android_sdk.png

Install the mPaaS plug-in

For installation instructions, see Install the mPaaS plug-in.

Configure the Gradle build tool

Your project must use Gradle Wrapper for builds.

  1. In Android Studio, open any Android project.

  2. Open the Settings dialog box.

  3. In the Gradle section, select Use default gradle wrapper and click Apply. use_gradle_wrapper.png