All Products
Search
Document Center

Adapt to multi-CPU architecture

Last Updated: Apr 01, 2021

Background

In the mPaaS standard baseline, the dynamic libraries (.so files) used by the SDK support the armeabi architecture only. However, some users also need support for other CPU architectures, such as the armeabi-v7a architecture, or the arm64-v8a architecture for apps on Google Play, so mPaaS supports this on custom baseline 10.1.68a. If your app needs to support an architecture other than armeabi, update the SDK described as follows and return to the relevant function.

Update SDK and relevant configurations

Update SDK

  • Use the mPaaS plug-in to upgrade the mPaaS SDK.
  • Use the Upgrade baseline function, check Custom baseline, and enter the baseline number cp_change_22487.
  • Use the Update components function to upgrade to the latest version and select the required components to install.

Overall compatibility

  • Support aar, inside, and portal & bundle accessing methods
  • Support armeabi, armeabi-v7a, arm64-v8a architectures
  • Support targetSdkVersion 26 - 28
  • Support Android 11

Released on Google Play

If your app needs to be released on Google Play and use the location component of mPaaS or the mapping function in the mini program, you need to remove the AMAP SDK built into mPaaS and use the official version provided by AMAP that can be approved by Google. Modify with reference to the following:

Update gradle configurations

aar

Update gradle version. We recommend version 6.2 and the earliest supported version is 5.0. If the latest version fails to compile, use the recommended version 6.2.

 
  1. distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip

inside/portal & bundle

Update gradle version. We recommend version 6.2 and the earliest supported version is 5.0. If the latest version fails to compile, use the recommended version 6.2.

 
  1. distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip

Update agp version:

  • For inside, modify it in the project root directory build.gradle<.
  • For portal & bundle, modify it in the root directory build.gradle of the portal project and all bundle projects.
 
  1. classpath 'com.alipay.android:android-gradle-plugin:3.5.14'
  2. classpath 'com.android.tools.build:gradle:3.5.3' // 3.5.0 earliest

Generate APK

Set CPU architecture

  • For aar/inside, set it in the build.gradle of the main project module.
  • For portal&bundle, set it in the build.gradle of the main module of the portal project if apk is generated, or in the build.gradle of the main module of the bundle project if the bundle is generated.

Set up abiFilters natively as follows:

 
  1. ndk {
  2. abiFilters "armeabi", "armeabi-v7a", "arm64-v8a"
  3. }

Compile

If there is no special configuration, just compile regularly.

Regression test