集成Tinker 热修复出现的问题

异常进程#线程

com.hl.indpark#main(2)

用户 ID

unknown

发生时间

2021-04-02 15:06:45

上报时间

2021-04-02 15:06:41

应用包名

com.hl.indpark

应用版本

1.0.2

使用时长

6 分 7 秒

前后台状态

后台

设备机型

OPPO PDBM00
系统版本

Android 9,level 28

ROM

Oppo/COLOROS

CPU架构

arm64-v8a

04-02 15:06:45.255 9736 10058 D libMEOW : plugin 1: [libMEOW_gift.so]:
12804-02 15:06:45.259 9736 9736 W com.hl.indpark: Rejecting class com.hl.indpark.uis.activities.videoactivities.BaseRtcActivity that attempts to sub-type erroneous class com.hl.indpark.uis.activities.videoactivities.BaseActivity in /data/user/0/com.hl.indpark/tinker/patch-754030e0/dex/tinker_classN.apk
12904-02 15:06:45.259 9736 9736 W com.hl.indpark: Rejecting class com.hl.indpark.uis.activities.videoactivities.BaseCallActivity that attempts to sub-type erroneous class com.hl.indpark.uis.activities.videoactivities.BaseRtcActivity in /data/user/0/com.hl.indpark/tinker/patch-754030e0/dex/tinker_classN.apk
13004-02 15:06:45.259 9736 9736 W com.hl.indpark: Rejecting class com.hl.indpark.uis.activities.MainActivity that attempts to sub-type erroneous class com.hl.indpark.uis.activities.videoactivities.BaseCallActivity in /data/user/0/com.hl.indpark/tinker/patch-754030e0/dex/tinker_classN.apk
13104-02 15:06:45.260 9736 9736 D AndroidRuntime: Shutting down VM
13204-02 15:06:45.260 9736 9736 E AndroidRuntime: FATAL EXCEPTION: main
13304-02 15:06:45.260 9736 9736 E AndroidRuntime: Process: com.hl.indpark, PID: 9736
13404-02 15:06:45.260 9736 9736 E AndroidRuntime: java.lang.VerifyError: Rejecting class com.hl.indpark.uis.activities.MainActivity that attempts to sub-type erroneous class com.hl.indpark.uis.activities.videoactivities.BaseCallActivity (declaration of ‘com.hl.indpark.uis.activities.MainActivity’ appears in /data/user/0/com.hl.indpark/tinker/patch-754030e0/dex/tinker_classN.apk)
13504-02 15:06:45.260 9736 9736 E AndroidRuntime: at java.lang.Class.newInstance(Native Method)
13604-02 15:06:45.260 9736 9736 E AndroidRuntime: at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:69)
13704-02 15:06:45.260 9736 9736 E AndroidRuntime: at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:41)
13804-02 15:06:45.260 9736 9736 E AndroidRuntime: at android.app.Instrumentation.newActivity(Instrumentation.java:1215)
13904-02 15:06:45.260 9736 9736 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3084)
14004-02 15:06:45.260 9736 9736 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3328)
14104-02 15:06:45.260 9736 9736 E AndroidRuntime: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
14204-02 15:06:45.260 9736 9736 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:113)
14304-02 15:06:45.260 9736 9736 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:71)
14404-02 15:06:45.260 9736 9736 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2054)
14504-02 15:06:45.260 9736 9736 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
14604-02 15:06:45.260 9736 9736 E AndroidRuntime: at android.os.Looper.loop(Looper.java:233)
14704-02 15:06:45.260 9736 9736 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7225)
14804-02 15:06:45.260 9736 9736 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
14904-02 15:06:45.260 9736 9736 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:499)
15004-02 15:06:45.260 9736 9736 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:962)
15104-02 15:06:45.260 9736 9736 E AndroidRuntime: Caused by: java.lang.VerifyError: Rejecting class com.hl.indpark.uis.activities.videoactivities.BaseCallActivity that attempts to sub-type erroneous class com.hl.indpark.uis.activities.videoactivities.BaseRtcActivity (declaration of ‘com.hl.indpark.uis.activities.videoactivities.BaseCallActivity’ appears in /data/user/0/com.hl.indpark/tinker/patch-754030e0/dex/tinker_classN.apk)
15204-02 15:06:45.260 9736 9736 E AndroidRuntime: … 16 more
15304-02 15:06:45.260 9736 9736 E AndroidRuntime: Caused by: java.lang.VerifyError: Rejecting class com.hl.indpark.uis.activities.videoactivities.BaseRtcActivity that attempts to sub-type erroneous class com.hl.indpark.uis.activities.videoactivities.BaseActivity (declaration of ‘com.hl.indpark.uis.activities.videoactivities.BaseRtcActivity’ appears in /data/user/0/com.hl.indpark/tinker/patch-754030e0/dex/tinker_classN.apk)
15404-02 15:06:45.260 9736 9736 E AndroidRuntime: … 16 more
15504-02 15:06:45.260 9736 9736 E AndroidRuntime: Caused by: java.lang.VerifyError: Verifier rejected class com.hl.indpark.uis.activities.videoactivities.BaseActivity: io.agora.rtc.RtcEngine com.hl.indpark.uis.activities.videoactivities.BaseActivity.e() failed to verify: io.agora.rtc.RtcEngine com.hl.indpark.uis.activities.videoactivities.BaseActivity.e(): [0x8] returning ‘Reference: io.agora.rtc.RtcEngine’, but expected from declaration ‘Reference: io.agora.rtc.RtcEngine’
15604-02 15:06:45.260 9736 9736 E AndroidRuntime: io.agora.rtm.RtmClient com.hl.indpark.uis.activities.videoactivities.BaseActivity.f() failed to verify: io.agora.rtm.RtmClient com.hl.indpark.uis.activities.videoactivities.BaseActivity.f(): [0x8] returning ‘Reference: io.agora.rtm.RtmClient’, but expected from declaration ‘Reference: io.agora.rtm.RtmClient’
15704-02 15:06:45.260 9736 9736 E AndroidRuntime: io.agora.rtm.RtmCallManager com.hl.indpark.uis.activities.videoactivities.BaseActivity.g() failed to verify: io.agora.rtm.RtmCallManager com.hl.indpark.uis.activities.videoactivities.BaseActivity.g(): [0x8] returning ‘Reference: io.agora.rtm.RtmCallManager’, but expected from declaration ‘Reference: io.agora.rtm.RtmCallManager’
15804-02 15:06:45.260 9736 9736 E AndroidRuntime: com.hl.indpark.uis.activities.videoactivities.a.a com.hl.indpark.uis.activities.videoactivities.BaseActivity.h() failed to verify: com.hl.indpark.uis.activities.videoactivities.a.a com.hl.indpark.uis.activities.videoactivities.BaseActivity.h(): [0x8] returning ‘Reference: com.hl.indpark.uis.activities.videoactivities.a.a’, but expected from declaration ‘Reference: com.hl.indpark.uis.activities.videoactivities.a.a’
15904-02 15:06:45.260 9736 9736 E AndroidRuntime: com.hl.indpark.uis.activities.videoactivities.a.c com.hl.indpark.uis.activities.videoactivities.BaseActivity.i() failed to verify: com.hl.indpark.uis.activities.videoactivities.a.c com.hl.indpark.uis.activities.videoactivities.BaseActivity.i(): [0x8] returning ‘Reference: com.hl.indpark.uis.activities.videoactivities.a.c’, but expected from declaration ‘Reference: com.hl.indpark.uis.activities.videoactivities.a.c’ (declaration of ‘com.hl.indpark.uis.activities.videoactivities.BaseActivity’ appears in /data/user/0/com.hl.indpark/tinker/patch-754030e0/dex/tinker_classN.apk)
16004-02 15:06:45.260 9736 9736 E AndroidRuntime: … 16 more
16104-02 15:06:45.261 9736 9736 E CrashReport: Java Crash Happen cause by main(2)

更新APP,或者热修复,应该会增加新的功能或者新的插件,一旦更新了新的东西,那么在混淆的时候也应该对新增的模块进行-keep,可能是这个问题导致的

使用的是云信令的demo
implementation ‘io.agora.rtc:full-sdk:3.1.0’
implementation ‘io.agora.rtm:rtm-sdk:1.2.2’
混淆规则配置
-keep class io.agora.**{*;}
还需要什么吗

混淆规则都有,还是这个问题

-dontwarn com.tencent.bugly.**
-keep public class com.tencent.bugly.**{*;}

tinker混淆规则

-dontwarn com.tencent.tinker.**
-keep class com.tencent.tinker.** { ; }
#agora
-keep class io.agora.**{
;}