Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Update@2019-12-18】ART内联或AOT导致VerifyError及其他类型的闪退 #1195

Open
tys282000 opened this issue Aug 22, 2019 · 12 comments

Comments

@tys282000
Copy link
Collaborator

长期问题,疑似屏蔽ClassTable的逻辑在Android P上开始失效,或DexDiff合成的dex有部分区段没有正确对齐,目前还在Debug确认。

@tys282000
Copy link
Collaborator Author

近期相关issue:
#1158
#1184
#1185

@tys282000 tys282000 changed the title ART内联或AOT导致VerifyError及其他类型的闪退 【Update@2019-12-18】ART内联或AOT导致VerifyError及其他类型的闪退 Dec 18, 2019
@tys282000
Copy link
Collaborator Author

请更新到 1.9.14.5 确认问题是否解决。

@same4869
Copy link

升级到1.9.14.5 手机p30 系统9.0 合成补丁后重启应用时必现此问题 3次crash后正常 补丁应用失败

@same4869
Copy link

补充下堆栈信息
2019-12-26 19:13:55.551 32435-32435/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.mihoyo.hyperion:pushcore, PID: 32435 java.lang.RuntimeException: Unable to instantiate application com.mihoyo.hyperion.app.HyperionApplication: com.tencent.tinker.loader.TinkerRuntimeException: Tinker Exception:createInlineFence failed at android.app.LoadedApk.makeApplication(LoadedApk.java:1183) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6688) at android.app.ActivityThread.access$2000(ActivityThread.java:273) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2020) at android.os.Handler.dispatchMessage(Handler.java:112) at android.os.Looper.loop(Looper.java:216) at android.app.ActivityThread.main(ActivityThread.java:7625) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987) Caused by: com.tencent.tinker.loader.TinkerRuntimeException: Tinker Exception:createInlineFence failed at com.tencent.tinker.loader.app.TinkerApplication.createInlineFence(TinkerApplication.java:11) at com.tencent.tinker.loader.app.TinkerApplication.onBaseContextAttached(TinkerApplication.java:5) at com.tencent.tinker.loader.app.TinkerApplication.attachBaseContext(TinkerApplication.java:3) at com.mihoyo.hyperion.app.HyperionApplication.attachBaseContext(Unknown Source:0) at android.app.Application.attach(Application.java:224) at android.app.Instrumentation.newApplication(Instrumentation.java:1128) at android.app.LoadedApk.makeApplication(LoadedApk.java:1175) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6688)  at android.app.ActivityThread.access$2000(ActivityThread.java:273)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2020)  at android.os.Handler.dispatchMessage(Handler.java:112)  at android.os.Looper.loop(Looper.java:216)  at android.app.ActivityThread.main(ActivityThread.java:7625)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)  Caused by: java.lang.VerifyError: Verifier rejected class com.mihoyo.hyperion.app.HyperionApplicationLike: void com.mihoyo.hyperion.app.HyperionApplicationLike.initAppEnvConfig(android.content.Context) failed to verify: void com.mihoyo.hyperion.app.HyperionApplicationLike.initAppEnvConfig(android.content.Context): [0x4] 'this' argument 'Precise Reference: com.mihoyo.commlib.utils.SPUtils$a' not instance of 'Precise Reference: com.mihoyo.commlib.utils.SPUtils$a' (declaration of 'com.mihoyo.hyperion.app.HyperionApplicationLike' appears in /data/user/0/com.mihoyo.hyperion/tinker/patch-2180faea/dex/tinker_classN.apk!classes2.dex) at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:343) at com.tencent.tinker.loader.app.TinkerApplication.createInlineFence(TinkerApplication.java:5) at com.tencent.tinker.loader.app.TinkerApplication.onBaseContextAttached(TinkerApplication.java:5)  at com.tencent.tinker.loader.app.TinkerApplication.attachBaseContext(TinkerApplication.java:3)  at com.mihoyo.hyperion.app.HyperionApplication.attachBaseContext(Unknown Source:0)  at android.app.Application.attach(Application.java:224)  at android.app.Instrumentation.newApplication(Instrumentation.java:1128)  at android.app.LoadedApk.makeApplication(LoadedApk.java:1175)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6688)  at android.app.ActivityThread.access$2000(ActivityThread.java:273)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2020)  at android.os.Handler.dispatchMessage(Handler.java:112)  at android.os.Looper.loop(Looper.java:216)  at android.app.ActivityThread.main(ActivityThread.java:7625)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)  2019-12-26 19:13:55.551 32435-32435/? E/Tinker.UncaughtHandler: TinkerUncaughtHandler catch exception:java.lang.RuntimeException: Unable to instantiate application com.mihoyo.hyperion.app.HyperionApplication: com.tencent.tinker.loader.TinkerRuntimeException: Tinker Exception:createInlineFence failed at android.app.LoadedApk.makeApplication(LoadedApk.java:1183) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6688) at android.app.ActivityThread.access$2000(ActivityThread.java:273) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2020) at android.os.Handler.dispatchMessage(Handler.java:112) at android.os.Looper.loop(Looper.java:216) at android.app.ActivityThread.main(ActivityThread.java:7625) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987) Caused by: com.tencent.tinker.loader.TinkerRuntimeException: Tinker Exception:createInlineFence failed at com.tencent.tinker.loader.app.TinkerApplication.createInlineFence(TinkerApplication.java:11) at com.tencent.tinker.loader.app.TinkerApplication.onBaseContextAttached(TinkerApplication.java:5) at com.tencent.tinker.loader.app.TinkerApplication.attachBaseContext(TinkerApplication.java:3) at com.mihoyo.hyperion.app.HyperionApplication.attachBaseContext(Unknown Source:0) at android.app.Application.attach(Application.java:224) at android.app.Instrumentation.newApplication(Instrumentation.java:1128) at android.app.LoadedApk.makeApplication(LoadedApk.java:1175) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6688)  at android.app.ActivityThread.access$2000(ActivityThread.java:273)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2020)  at android.os.Handler.dispatchMessage(Handler.java:112)  at android.os.Looper.loop(Looper.java:216)  at android.app.ActivityThread.main(ActivityThread.java:7625)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)  Caused by: java.lang.VerifyError: Verifier rejected class com.mihoyo.hyperion.app.HyperionApplicationLike: void com.mihoyo.hyperion.app.HyperionApplicationLike.initAppEnvConfig(android.content.Context) failed to verify: void com.mihoyo.hyperion.app.HyperionApplicationLike.initAppEnvConfig(android.content.Context): [0x4] 'this' argument 'Precise Reference: com.mihoyo.commlib.utils.SPUtils$a' not instance of 'Precise Reference: com.mihoyo.commlib.utils.SPUtils$a' (declaration of 'com.mihoyo.hyperion.app.HyperionApplicationLike' appears in /data/user/0/com.mihoyo.hyperion/tinker/patch-2180faea/dex/tinker_classN.apk!classes2.dex) at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:343) at com.tencent.tinker.loader.app.TinkerApplication.createInlineFence(TinkerApplication.java:5) at com.tencent.tinker.loader.app.TinkerApplication.onBaseContextAttached(TinkerApplication.java:5)  at com.tencent.tinker.loader.app.TinkerApplication.attachBaseContext(TinkerApplication.java:3)  at com.mihoyo.hyperion.app.HyperionApplication.attachBaseContext(Unknown Source:0)  at android.app.Application.attach(Application.java:224)  at android.app.Instrumentation.newApplication(Instrumentation.java:1128)  at android.app.LoadedApk.makeApplication(LoadedApk.java:1175)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6688)  at android.app.ActivityThread.access$2000(ActivityThread.java:273)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2020)  at android.os.Handler.dispatchMessage(Handler.java:112)  at android.os.Looper.loop(Looper.java:216)  at android.app.ActivityThread.main(ActivityThread.java:7625)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)  2019-12-26 19:13:55.551 1308-2180/? E/ActivityManager: The same pid with last one, do not add dropbox and clear mLastCrashedPid. mLastAppCrashedPid==32435

@same4869
Copy link

same4869 commented Jan 2, 2020

另外 仿照demo实现了UncaughtExceptionHandler 然而挂的时候感觉并没有走到tinkerFastCrashProtect方法 3次crash的然后应用失败的逻辑在这里设置不了 请问还有在其他地方可以设置吗(比如想改成1次crash就算失败,毕竟连挂3次有点太打扰用户)

@98Degree
Copy link

我现在打包这个问题必现,有处理方案吗?

@listen2code
Copy link

这个问题近期修复了吗?28,29的部分机型(并不集中)在bugly上还是会报。

@fzyzcjy
Copy link

fzyzcjy commented Mar 13, 2022

看到这个issue还在pin,请问修复了吗

@AmoryPepelu
Copy link

请问有修复么?🥹

@isanwenyu
Copy link

isanwenyu commented Dec 8, 2022

华为Mate 20 Pro Android10碰到类似问题,tinker版本为1.9.14.3 ,@tys282000 请问有解决方案吗?
Build fingerprint: 'HUAWEI/LYA-AL00L/HWLYA:10/HUAWEILYA-AL00L/10.1.0.163C00:user/release-keys'
Revision: '0'
ABI: 'arm64'
SYSVMTYPE: Maple
APPVMTYPE: Art
Abort message: 'Inlined method resolution crossed dex file boundary: from java.io.File xxx.HotfixUtils.getValidFile(android.content.Context) in /data/app/xxx-lK_u_ObFS8rB7OoP7pUkRA==/base.apk!classes3.dex/0x735508f340 to void xxx.hotfix.SecurityChecker.(android.content.Context) in /data/user/0/xxx/tinker/patch-49a0bcf4/dex/tinker_classN.apk!classes7.dex/0x734ee51400. This must be due to duplicate classes or playing wrongly with class loaders. The runtime is in an unsafe state.'

@AmoryPepelu
Copy link

AmoryPepelu commented Mar 17, 2023

更新下我遇到的问题,之前有遇到过这样的异常

Inlined method resolution crossed dex file boundary: 
from androidx.lifecycle.LifecycleCoroutineScope androidx.lifecycle.LifecycleKt.getCoroutineScope(androidx.lifecycle.Lifecycle) in 
/data/app/~~0d517gkZ5K6RSn2_ejprRg==/com.xiaolachuxing.driver-
r5nbB3wUsZHUlm0t2mRWhw==/base.apk/0x7f009c1380 to void androidx.lifecycle.LifecycleCoroutineScopeImpl.register() 
in /data/user/0/com.xiaolachuxing.driver/tinker/patch-a414dddb/dex/tinker_classN.apk/0x7f13495b40. This must be due to 
duplicate classes or playing wrongly with class loaders. The runtime is in an unsafe state.

是因为我的基准包没有加固,但打的补丁包选择了加固造成的。

 tinkerPatch {
      buildConfig {
           isProtectedApp = true
      }
}

复现:在一台Android 9.0的手机上,把tinker配置里的加固打开 -> 打补丁包 -> 安装没有加固的基准包 -> 使用adb命令触发手机系统编译优化 -> 打开app -> 加载补丁 -> 杀进程 -> 再次使用adb命令触发手机系统编译优化 -> 再打开APP就会触发inline崩溃。
然后我把tinker配置的加固关闭,同样的步骤就没有复现。

如果安装的是加固包,加载未加固的补丁,则补丁不生效,使用加固的补丁可以生效,并且触发编译优化也不会造成inline问题。

总结为:
加固的安装包 -> 下发加固的补丁
未加固的安装包 -> 下发未加固的补丁

打补丁包时依赖的基准包是未加固的包。

编译优化:

adb shell cmd package compile -m speed-profile -f ${package_name}

@weiwenjuan
Copy link

1.9.14.12 都是未加固的,Android10 会必出现启动闪退的问题,请问咋修复?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants