开发者社区> 问答> 正文

【移动热修复】Sophix关于Utils依赖包注意事项有哪些?

Sophix关于Utils依赖包注意事项

展开
收起
EMAS支持组 2022-09-27 15:09:59 1986 0
1 条回答
写回答
取消 提交回答
  • 什么是 Utils SDK?Utils为阿里云移动云各产品SDK的公共依赖包,包含基础功能和公共功能模块的实现。Utils SDK接口会被各阿里云SDK产品调用,用户集成时不会直接调用其接口。

    Sophix热修复中所依赖的Utils包版本最低需要为1.0.3。

    如使用了多个阿里云SDK产品,导致重复依赖多个Utils SDK,必须只保留某个产品中的最高版本的Utils包,同时删除其他产品中的Utils包。远程依赖时使用exclude(module:’alicloud-android-utils’)进行删除。

    如最终保留的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时可能报如下错误:

    Warning:com.alibaba.sdk.android.utils.c$1: can't find superclass or interface com.ut.mini.IUTApplication
    Warning:com.alibaba.sdk.android.utils.c: can't find referenced class com.ut.mini.UTAnalytics
    Warning:com.alibaba.sdk.android.utils.c: can't find referenced class com.ut.mini.UTHitBuilders
    Warning:com.alibaba.sdk.android.utils.c: can't find referenced class com.ut.mini.UTHitBuilders$UTCustomHitBuilder
    Warning:com.alibaba.sdk.android.utils.c: can't find referenced class com.ut.mini.UTHitBuilders$UTHitBuilder
    Warning:com.alibaba.sdk.android.utils.c: can't find referenced class com.ut.mini.UTTracker
    Warning:com.alibaba.sdk.android.utils.c: can't find referenced class com.ut.mini.UTAnalytics
    Warning:com.alibaba.sdk.android.utils.c: can't find referenced class com.ut.mini.UTHitBuilders$UTCustomHitBuilder
    Warning:com.alibaba.sdk.android.utils.c: can't find referenced class com.ut.mini.UTTracker
    Warning:com.alibaba.sdk.android.utils.c$1: can't find referenced class com.ut.mini.IUTApplication
    Warning:com.alibaba.sdk.android.utils.c$1: can't find referenced class com.ut.mini.core.sign.UTBaseRequestAuthentication
    Warning:com.alibaba.sdk.android.utils.c$1: can't find referenced class com.ut.mini.core.sign.IUTRequestAuthentication
    Warning:com.alibaba.sdk.android.utils.c$1: can't find referenced class com.ut.mini.crashhandler.IUTCrashCaughtListner
    Warning:there were 19 unresolved references to classes or interfaces.
    

    或者可能报如下错误:

    
    Warning:com.alibaba.sdk.android.utils.crashdefend.a$b: can't find superclass or interface com.alibaba.sdk.android.beacon.Beacon$OnUpdateListener
    Warning:com.alibaba.sdk.android.utils.crashdefend.a: can't find referenced class com.alibaba.sdk.android.beacon.Beacon
    Warning:com.alibaba.sdk.android.utils.crashdefend.a: can't find referenced class com.alibaba.sdk.android.beacon.Beacon$Builder
    Warning:com.alibaba.sdk.android.utils.crashdefend.a: can't find referenced class com.alibaba.sdk.android.beacon.Beacon$OnUpdateListener
    Warning:com.alibaba.sdk.android.utils.crashdefend.a: can't find referenced class com.alibaba.sdk.android.beacon.Beacon
    Warning:com.alibaba.sdk.android.utils.crashdefend.a: can't find referenced class com.alibaba.sdk.android.beacon.Beacon$Builder
    Warning:com.alibaba.sdk.android.utils.crashdefend.a: can't find referenced class com.alibaba.sdk.android.beacon.Beacon
    Warning:com.alibaba.sdk.android.utils.crashdefend.a$b: can't find referenced class com.alibaba.sdk.android.beacon.Beacon
    Warning:com.alibaba.sdk.android.utils.crashdefend.a$b: can't find referenced class com.alibaba.sdk.android.beacon.Beacon$Config
    Warning:com.alibaba.sdk.android.utils.crashdefend.a$b: can't find referenced class com.alibaba.sdk.android.beacon.Beacon$OnUpdateListener
    Warning:com.alibaba.sdk.android.utils.crashdefend.a$b: can't find referenced class com.alibaba.sdk.android.beacon.Beacon$Config
    Warning:com.alibaba.sdk.android.utils.crashdefend.a$b: can't find referenced class com.alibaba.sdk.android.beacon.Beacon
    Warning:com.alibaba.sdk.android.utils.crashdefend.a$b: can't find referenced class com.alibaba.sdk.android.beacon.Beacon$Config
    Warning:there were 21 unresolved references to classes or interfaces.
    

    如出现以上两种报错,或类似Warning:com.alibaba.sdk.android.utils.**的报错,在混淆规则中添加-dontwarn com.alibaba.sdk.android.utils.**即可解决。


    更多官方信息

    EMAS官网介绍:https://www.aliyun.com/product/emas

    Devops:https://www.aliyun.com/product/emascrash/mobile_devops

    移动热修复:https://www.aliyun.com/product/hotfix

    移动测试:https://www.aliyun.com/activity/emas/mqcexpert

    移动推送:https://www.aliyun.com/product/cps

    HTTPDNS:https://www.aliyun.com/product/httpdns

    EMAS 控制台: https://emas.console.aliyun.com/products

    2022-09-27 15:31:06
    赞同 展开评论 打赏
来源圈子
更多
收录在圈子:
基于阿里巴巴以及合作伙伴的最佳实践,围绕大前端、云原生领域的相关技术热点(小程序、Serverless、应用中间件、低代码、DevOps)展开行业探讨,与开发者一起探寻云原生时代应用研发的新范式。
问答排行榜
最热
最新

相关电子书

更多
移动热修复新品发布 立即下载
阿里云移动服务新品发布-移动热修复 立即下载
《Java开发手册》2019最新版发布! 立即下载