All Products
Search
Document Center

Solve conflict with dependency on wire/okio

Last Updated: Apr 01, 2021

Conflict description

As mPaaS uses wire/okio for RPC network connection, and okhttp also needs to reference okio, so when you use mPaaS with okhttp, then there may be a wire/okio conflict.

Solution

Remove the wire/okio dependency from mPaaS and perform regression testing of the Mobile gateway to ensure its proper function.

Procedure

  1. Confirm the version of wire/okio used by mPaaS.

       
    1. 'com.squareup.okio:okio:1.7.0@jar'
    2. 'com.squareup.wire:wire-lite-runtime:1.5.3.4@jar'
  2. Get the group:artifact information for the mPaaS third-party SDK.

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

    • AAR method
      If you are using the native AAR method to access mPaaS, the dependency passing of gradle will automatically use a later version and there is no need to actively remove it. In general, the version chosen for use by mPaaS is highly stable and secure, and we recommend you to use the version provided by mPaaS. If versions are inconsistent, please test the mPaaS function before its launch to ensure stability.
    • mPaaS Inside and Portal&Bundle
           
      1. mpaascomponents {
      2. excludeDependencies = ["com.alipay.android.phone.thirdparty:wire-build"]
      3. }
  4. Add back wire or okio (use wire/okio of public network. The native AAR access method is not a concern).
    As mPaaS writes dependency of both wire and okio in the com.alipay.android.phone.thirdparty:wire-build library, you need to add them back optionally, as the case may be.

    • If there is only an okio conflict, but not a wire conflict, you need to add back the wire.

           
      1. implementation 'com.squareup.wire:wire-lite-runtime:1.5.3.4@jar'
    • If there is only a wire conflict, but not an okio conflict, you need to add back the okio.

           
      1. 'com.squareup.okio:okio:1.7.0@jar'