All Products
Search
Document Center

Solve conflict with dependency on Android support

Last Updated: Sep 23, 2021

Android support conflict between Portal & Bundle and mPaaS Inside accessing methods

Conflict description

mPaaS has a built-in support library based on version 23.2.1, and added Fragment aspect logic for automated buried-points for pages. If you add the official version of the android support library while using mPaaS, there will be an android support conflict.

Solution

Remove androidsupport-build and replace it directly with the official version. If you also need to use the Fragment automated logging feature provided by mPaaS, you need to manually add the monitoring logic.

Note: The native AAR method does not have a built-in support library, so you are not required to make any action. If you also need to use the Fragment automated logging feature provided by mPaaS, you need to manually add the monitoring logic.

Procedure

  1. Confirm the version of android support currently used by mPaaS.

       
    1. 'com.android.support:support-v4'
    2. 'com.android.support:appcompat-v7'
  2. Get the group:artifact information for the mPaaS third-party SDK.

       
    1. 'com.alipay.android.phone.thirdparty:androidsupport-build'
    2. 'com.alipay.android.phone.thirdparty:androidsupportrecyclerview-build'
  3. Remove the mPaaS library.

    • AAR method
      If you are accessing mPaaS by using a native AAR, you do not need to actively remove it.

    • mPaaS Inside and Portal & Bundle

           
      1. mpaascomponents {
      2. excludeDependencies = [
      3. "com.alipay.android.phone.thirdparty:androidsupport-build"
      4. ]
      5. }

Android support conflicts in the native AAR access method

Conflict description

The native AAR access method uses the support-v4 library based on version 23.4.0. However, Google has changed the way it organizes its code since version 24.2.0, and no longer provides all modules of the support-v4 library in a package, and appcompat-v7 introduces all modules of the library in a package, see the Support library packages. Therefore, an AAR dependency conflict will occur when your project uses the appcompat-v7 package.

Solution

Manually import a later version of support-v4, along with the appcompat-v7 you need.

Procedure

  1. Manually import a later version of support-v4.

       
    1. implementation 'com.android.support:support-v4: (version you used, for example, 28.0.0)'
  2. Import appcompat-v7 you need.

       
    1. implementation 'com.android.support:appcompat-v7: (version you used, for example, 28.0.0)'