Sophix关于Utils依赖包注意事项
什么是 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
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。