All Products
Search
Document Center

Mobile Platform as a Service:Handle iOS conflict

Last Updated:Aug 12, 2024

When accessing mPaaS, the mPaaS SDK may conflict with other open-source libraries or third-party libraries introduced into the project, leading to project compilation failure. This topic introduces the solutions to two common types of conflicts.

Based on the types of libraries that cause the conflict, two categories of solutions are available:

  • mPaaS custom libraries: If custom libraries of the mPaaS SDK conflict with other libraries in the project, you must use these custom mPaaS libraries.

  • Non-mPaaS custom libraries: If conflicting mPaaS SDK libraries are not mPaaS custom libraries, you can delete the libraries introduced by mPaaS.

Solutions to conflicting mPaaS custom libraries

If conflicting mPaaS SDK libraries are custom libraries, you must use these custom mPaaS libraries.

Open-source library name

mPaaS library name

Conflict solution

AlipaySDK

AlipaySDK

The mPaaS version, which solves conflicts with modules such as mPaaS RPC and UTDID, must be used. At the same time, the mPaaS_RPC component needs to be integrated.

OpenSSL

APOpenSSL

The mPaaS version, which optimizes the original national secret algorithm, must be used. For more details, please refer to How to solve the OpenSSL conflict in iOS projects.

protocolBuffers

APProtocolBuffers

The mPaaS version must be used.

Solutions to non-mPaaS custom libraries

If conflicting mPaaS SDK libraries are not mPaaS custom libraries, you can delete the libraries introduced by mPaaS. The deletable libraries are shown in the following table. For details, see Remove conflicting third-party libraries to remove the conflicting libraries.

Components supported by remove_pod

Open-source libraries contained

mPaaS_SDWebImage

SDWebImage

mPaaS_Masonry

Masonry

mPaaS_MBProgressHud

MBProgressHUD

mPaaS_TTTAttributedLabel

TTTAttributedLabel

mPaaS_Lottie

Lottie

mPaaS_AMap

AMapSearchKit

AMapFoundationKit

MAMapKit

mPaaS_Security

SecurityGuard

SGMain

mPaaS_APWebP

WebP

Remove conflicting third-party libraries

If the conflicting mPaaS SDK library is not a mPaaS custom library, you can delete the library introduced by mPaaS according to the following procedures.

Procedure

  1. Install the beta version of the cocoapods-mPaaS plug-in.

    Note

    The beta version of the cocoapods-mPaaS plug-in is supported only in the 10.2.3 baseline.

    sh <(curl -s http://mpaas-ios-test.oss-cn-hangzhou.aliyuncs.com/cocoapods/installmPaaSCocoaPodsPlugin.sh)

    After the installation is completed, run the command pod mpaas version --plugin to verify that the installed version is the beta version.

  2. Run the pod mpaas update 10.2.3 command again to update the local baseline.

  3. Introduce remove_pod "mPaaS_xxx" to podfile and be sure to place remove_pod before a common mPaaS_pod command.

    For example, to remove SDWebImage, run this command: remove_pod “mPaaS_SDWebImage”.

    remove_pod "mPaaS_SDWebImage"
    mPaaS_pod "mPaaS_CommonUI"
    pod 'xxx' # The corresponding third-party native library
  4. After you remove the mPaaS component library, you can run the pod install command to introduce the native version.