All Products
Search
Document Center

Mobile Platform as a Service:Upgrade componentized or mPaaS Inside integration mode to Native AAR mode

Last Updated:Sep 07, 2023

AAR integration refers to the mode that almost uses native integration. When AAR integration is used, to meet the need for mPaaS baseline management, you need to use the latest stable Android Gradle Plugin and Gradle Wrapper versions. Android Gradle Plugin 3.5.3 and Gradle Wrapper 5.6 or later versions are recommended. Currently, Android Gradle Plugin 3.6.x and Gradle Wrapper 6.3 are stable.

Preparation

  1. Upgrade easyconfig plugin to 2.8.0.

  2. Upgrade gradle to 5.0 and above.

Upgrade componentized integration mode to AAR integration mode

Changes in the plugins

  • Update Gradle Wrapper and Android Gradle Plugin to the version you need. Gradle's version should be 5.0 and above.

  • Remove classpath 'com.alipay.android:android-gradle-plugin' from the build.gradle file under every program's root directory.

  • Remove all com.android.application from the bundle projects, and use com.android.library from native projects in the bundle projects.

  • Remove all com.alipay.bundle from the bundle projects.

  • Remove all definitions of bundle {} and public.xml from bundle projects, unless special needs.

  • Remove all com.alipay.portal from the portal projects.

  • Remove all definitions of portal {} and public.xml from portal projects, unless special needs.

  • Update apply plugin: 'com.alipay.apollo.baseline.update' with apply plugin: 'com.alipay.apollo.baseline.config'.

Changes in the dependencies

  • Remove all the declarations of provided and bundle from dependencies node, and integrate the AAR dependencies with BOM mode.

        implementation 'com.mpaas.android:push'
        implementation 'com.mpaas.android:nebula'
        implementation 'com.mpaas.android:push-hms5'
        implementation platform("com.mpaas.android:mpaas-baseline:$(latest)")
    
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'androidx.test.ext:junit:1.1.1'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    $(latest) is the latest mPaaS baseline version. If the standard baseline is used, the value of mpaas-baseline doesn't need update. If the customized baseline is used, the value of mpaas-baseline should be updated with customized baseline's artifact.

  • Remove the load and customization of the framework. For more information, please refer to the document Load and customize the framework.

Changes in the usage of common components

If the components are defined in metainfo.xml mode, please refer to the document Use common components of mPaaS.

Changes in the files

The files of slinks and res_slinks are not needed.

Possible issues

Because the v1 signature is disabled by default in higher versions, it may cause the wireless bodyguard to report an error when the v1 signature does not exist. Please refer to How to fix 608 errors at runtime or native errors with libsgmain for the solution.

Self-examination

For self-examination, please refer to the document Check configurations of the build script.

Upgrade inside integration mode to AAR integration mode

Changes in the plugins

  • Update Gradle Wrapper and Android Gradle Plugin to the version you need. Gradle's version should be 5.0 and above.

  • Remove classpath 'com.alipay.android:android-gradle-plugin' from the build.gradle file under every program's root directory.

  • Remove all com.alipay.portal from the portal projects.

  • Remove all definitions of portal {} and public.xml from portal projects, unless special needs.

  • Update apply plugin: 'com.alipay.apollo.baseline.update' with apply plugin: 'com.alipay.apollo.baseline.config'.

Changes in the dependencies

Remove all the declarations of provided and bundle from dependencies node, and integrate the AAR dependencies with BOM mode.

    implementation 'com.mpaas.android:push'
    implementation 'com.mpaas.android:nebula'
    implementation 'com.mpaas.android:push-hms5'
    implementation platform("com.mpaas.android:mpaas-baseline:$(latest)")

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

$(latest) is the latest mPaaS baseline version. If the standard baseline is used, the value of mpaas-baseline doesn't need update. If the customized baseline is used, the value of mpaas-baseline should be updated with customized baseline's artifact.

Changes in the usage of common components

If the components are defined in metainfo.xml mode, please refer to the document Use common components of mPaaS.

Changes of gradle.properties

The configuration quinoxless=true is not needed. The existing quinoxless=true can be either kept or deleted.

Possible issues

Because the v1 signature is disabled by default in higher versions, it may cause the wireless bodyguard to report an error when the v1 signature does not exist. Please refer to How to fix 608 errors at runtime or native errors with libsgmain for the solution.

Self-examination

For self-examination, please refer to the document Check configurations of the build script.

Integrate in AAR integration mode

  1. Add mPaaS SDK to the project.

  2. Add components to use in each module.