全部产品
云市场

Sophix关于Utils依赖包注意事项

更新时间:2018-05-08 16:45:47

  • 1.什么是 Utils SDK?Utils为阿里云移动云各产品SDK的公共依赖包,包含基础功能和公共功能模块的实现。Utils SDK接口会被各阿里云SDK产品调用,用户集成时不会直接调用其接口。
  • 2.Sophix热修复中所依赖的Utils包版本最低需要为1.0.3。
  • 3.如使用了多个阿里云SDK产品,导致重复依赖多个Utils SDK,必须只保留某个产品中的最高版本的Utils包,同时删除其他产品中的的Utils包。远程依赖时使用exclude(module:’alicloud-android-utils’)进行删除。
  • 4.如最终保留的Utils包是1.1.1或以上版本(热修复最新版本包含的是1.1.3版本),需要注意:
    • 远程依赖时,可能直接携带了ut的一个依赖包,这时如果出现冲突,可添加exclude(module:’alicloud-android-ut’)进行过滤,但是这样过滤后,utdid包也会同时移除掉,需要查看项目的所有阿里系依赖,最后只保留一份1.1.5.3版本以上的utdid包。
    • 本地依赖时,或远程依赖时添加exclude(module:’alicloud-android-ut’)进行过滤后,混淆开启后打包生成apk时可能报如下错误:
      1. Warning:com.alibaba.sdk.android.utils.c$1: can't find superclass or interface com.ut.mini.IUTApplication
      2. Warning:com.alibaba.sdk.android.utils.c: can't find referenced class com.ut.mini.UTAnalytics
      3. Warning:com.alibaba.sdk.android.utils.c: can't find referenced class com.ut.mini.UTHitBuilders
      4. Warning:com.alibaba.sdk.android.utils.c: can't find referenced class com.ut.mini.UTHitBuilders$UTCustomHitBuilder
      5. Warning:com.alibaba.sdk.android.utils.c: can't find referenced class com.ut.mini.UTHitBuilders$UTHitBuilder
      6. Warning:com.alibaba.sdk.android.utils.c: can't find referenced class com.ut.mini.UTTracker
      7. Warning:com.alibaba.sdk.android.utils.c: can't find referenced class com.ut.mini.UTAnalytics
      8. Warning:com.alibaba.sdk.android.utils.c: can't find referenced class com.ut.mini.UTHitBuilders$UTCustomHitBuilder
      9. Warning:com.alibaba.sdk.android.utils.c: can't find referenced class com.ut.mini.UTTracker
      10. Warning:com.alibaba.sdk.android.utils.c$1: can't find referenced class com.ut.mini.IUTApplication
      11. Warning:com.alibaba.sdk.android.utils.c$1: can't find referenced class com.ut.mini.core.sign.UTBaseRequestAuthentication
      12. Warning:com.alibaba.sdk.android.utils.c$1: can't find referenced class com.ut.mini.core.sign.IUTRequestAuthentication
      13. Warning:com.alibaba.sdk.android.utils.c$1: can't find referenced class com.ut.mini.crashhandler.IUTCrashCaughtListner
      14. Warning:there were 19 unresolved references to classes or interfaces.
    • 或者可能报如下错误:
      1. Warning:com.alibaba.sdk.android.utils.crashdefend.a$b: can't find superclass or interface com.alibaba.sdk.android.beacon.Beacon$OnUpdateListener
      2. Warning:com.alibaba.sdk.android.utils.crashdefend.a: can't find referenced class com.alibaba.sdk.android.beacon.Beacon
      3. Warning:com.alibaba.sdk.android.utils.crashdefend.a: can't find referenced class com.alibaba.sdk.android.beacon.Beacon$Builder
      4. Warning:com.alibaba.sdk.android.utils.crashdefend.a: can't find referenced class com.alibaba.sdk.android.beacon.Beacon$OnUpdateListener
      5. Warning:com.alibaba.sdk.android.utils.crashdefend.a: can't find referenced class com.alibaba.sdk.android.beacon.Beacon
      6. Warning:com.alibaba.sdk.android.utils.crashdefend.a: can't find referenced class com.alibaba.sdk.android.beacon.Beacon$Builder
      7. Warning:com.alibaba.sdk.android.utils.crashdefend.a: can't find referenced class com.alibaba.sdk.android.beacon.Beacon
      8. Warning:com.alibaba.sdk.android.utils.crashdefend.a$b: can't find referenced class com.alibaba.sdk.android.beacon.Beacon
      9. Warning:com.alibaba.sdk.android.utils.crashdefend.a$b: can't find referenced class com.alibaba.sdk.android.beacon.Beacon$Config
      10. Warning:com.alibaba.sdk.android.utils.crashdefend.a$b: can't find referenced class com.alibaba.sdk.android.beacon.Beacon$OnUpdateListener
      11. Warning:com.alibaba.sdk.android.utils.crashdefend.a$b: can't find referenced class com.alibaba.sdk.android.beacon.Beacon$Config
      12. Warning:com.alibaba.sdk.android.utils.crashdefend.a$b: can't find referenced class com.alibaba.sdk.android.beacon.Beacon
      13. Warning:com.alibaba.sdk.android.utils.crashdefend.a$b: can't find referenced class com.alibaba.sdk.android.beacon.Beacon$Config
      14. Warning:there were 21 unresolved references to classes or interfaces.
    • 如出现以上两种报错,或类似Warning:com.alibaba.sdk.android.utils.**的报错,在混淆规则中添加-dontwarn com.alibaba.sdk.android.utils.**即可解决。

若上述步骤仍未能定位问题,可以询问技术支持解决:技术支持