Open zysidea opened 5 years ago
补充关于JobScheduler堆栈日志,没有打开MIUI的自启动
异常类型:app运行时异常
手机型号:小米6x
手机系统版本:9.0
tinker版本:1.9.9 和 1.9.13
gradle版本:3.1.1
是否使用热更新SDK: Bugly SDK
系统:Mac
堆栈/日志:
2019-05-05 20:30:22.713 2352-4794/? I/AutoStartManagerService: MIUILOG- Reject service :Intent { cmp=com.yuncheapp.android.pearl/com.tencent.tinker.lib.service.TinkerPatchService } userId : 0 uid : 10529
2019-05-05 20:30:22.714 2352-4794/? D/JobScheduler: Error executing JobStatus{542d1b3 #u0a529/-642605764 com.yuncheapp.android.pearl/com.tencent.tinker.lib.service.TinkerPatchService u=0 s=10529 TIME=none:-2ms READY}
补丁对应的完整包在运行的时候会报这个错误吗? 可以试试直接安装完整新包看看log里有没有类似的输出。
小米6x android9.0 安装上述生成的完成的包
直接运行完整包,堆栈错误如下:
java.lang.RuntimeException: Unable to instantiate application com.kuaishou.athena.tinker.KwaiApplication: com.tencent.tinker.loader.TinkerRuntimeException: Tinker Exception:fail to invoke onBaseContextAttached of appLike.
at android.app.LoadedApk.makeApplication(LoadedApk.java:1073)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5920)
at android.app.ActivityThread.access$1200(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6810)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Caused by: com.tencent.tinker.loader.TinkerRuntimeException: Tinker Exception:fail to invoke onBaseContextAttached of appLike.
at com.tencent.tinker.loader.app.TinkerApplication.invokeAppLikeOnBaseContextAttached(TinkerApplication.java:133)
at com.tencent.tinker.loader.app.TinkerApplication.onBaseContextAttached(TinkerApplication.java:148)
at com.tencent.tinker.loader.app.TinkerApplication.attachBaseContext(TinkerApplication.java:164)
at android.app.Application.attach(Application.java:215)
at android.app.Instrumentation.newApplication(Instrumentation.java:1122)
at android.app.LoadedApk.makeApplication(LoadedApk.java:1065)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5920)
at android.app.ActivityThread.access$1200(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6810)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
但是在android 7.1(包含)以下,补丁可以应用成功,而且直接安装完整包也没有报错 @tomystang ps: 上述完整的包是执行bugly的buildTinkerPatchRelease生成的包
这个堆栈前后还有其他信息吗?尤其是后面应该还有几个cause by才对的
java.lang.RuntimeException: Unable to instantiate application com.kuaishou.athena.tinker.KwaiApplication: com.tencent.tinker.loader.TinkerRuntimeException: Tinker Exception:fail to invoke onBaseContextAttached of appLike.
at android.app.LoadedApk.makeApplication(LoadedApk.java:1073)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5920)
at android.app.ActivityThread.access$1200(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6810)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Caused by: com.tencent.tinker.loader.TinkerRuntimeException: Tinker Exception:fail to invoke onBaseContextAttached of appLike.
at com.tencent.tinker.loader.app.TinkerApplication.invokeAppLikeOnBaseContextAttached(TinkerApplication.java:133)
at com.tencent.tinker.loader.app.TinkerApplication.onBaseContextAttached(TinkerApplication.java:148)
at com.tencent.tinker.loader.app.TinkerApplication.attachBaseContext(TinkerApplication.java:164)
at android.app.Application.attach(Application.java:215)
at android.app.Instrumentation.newApplication(Instrumentation.java:1122)
at android.app.LoadedApk.makeApplication(LoadedApk.java:1065)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5920)
at android.app.ActivityThread.access$1200(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6810)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.tencent.tinker.loader.app.TinkerApplication.invokeAppLikeOnBaseContextAttached(TinkerApplication.java:131)
at com.tencent.tinker.loader.app.TinkerApplication.onBaseContextAttached(TinkerApplication.java:148)
at com.tencent.tinker.loader.app.TinkerApplication.attachBaseContext(TinkerApplication.java:164)
at android.app.Application.attach(Application.java:215)
at android.app.Instrumentation.newApplication(Instrumentation.java:1122)
at android.app.LoadedApk.makeApplication(LoadedApk.java:1065)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5920)
at android.app.ActivityThread.access$1200(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6810)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lio/reactivex/internal/schedulers/j;
at io.reactivex.f.a$g.<clinit>(Schedulers.java:58)
at io.reactivex.f.a$h.call(Schedulers.java:1387)
at io.reactivex.e.a.a(RxJavaPlugins.java:1306)
at io.reactivex.f.a.<clinit>(Schedulers.java:2319)
at io.reactivex.f.a.a(Schedulers.java:341)
at com.kwai.a.a.<init>(Async.java:53)
at com.kwai.a.a.<init>(Async.java:21)
at com.kwai.a.a$a.<clinit>(Async.java:38)
at com.kwai.a.a.a(Async.java:1042)
at com.kuaishou.athena.storage.preference.a.<init>(BaseSharedPreferences.java:2039)
at com.kuaishou.athena.storage.preference.i.<init>(ProviderPreferences.java:25)
at com.kuaishou.athena.storage.preference.f.a(MultiProcessSharedPreferences.java:152)
at com.kuaishou.athena.storage.preference.f.<init>(MultiProcessSharedPreferences.java:29)
at com.kuaishou.athena.account.Account.e(Account.java:282)
at com.kuaishou.athena.account.CurrentUser.<init>(CurrentUser.java:32)
at com.kuaishou.athena.init.module.PreferenceInitModule.a(PreferenceInitModule.java:74)
at com.kuaishou.athena.KwaiAppLike.onBaseContextAttached(KwaiAppLike.java:2122)
at java.lang.reflect.Method.invoke(Native Method)
at com.tencent.tinker.loader.app.TinkerApplication.invokeAppLikeOnBaseContextAttached(TinkerApplication.java:131)
at com.tencent.tinker.loader.app.TinkerApplication.onBaseContextAttached(TinkerApplication.java:148)
at com.tencent.tinker.loader.app.TinkerApplication.attachBaseContext(TinkerApplication.java:164)
at android.app.Application.attach(Application.java:215)
at android.app.Instrumentation.newApplication(Instrumentation.java:1122)
at android.app.LoadedApk.makeApplication(LoadedApk.java:1065)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5920)
at android.app.ActivityThread.access$1200(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6810)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Caused by: java.lang.ClassNotFoundException: Didn't find class "io.reactivex.internal.schedulers.j" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.yuncheapp.android.pearl--QuKZdBF2skjYCOqZmrQUg==/base.apk"],nativeLibraryDirectories=[/data/app/com.yuncheapp.android.pearl--QuKZdBF2skjYCOqZmrQUg==/lib/arm, /system/fake-libs, /data/app/com.yuncheapp.android.pearl--QuKZdBF2skjYCOqZmrQUg==/base.apk!/lib/armeabi-v7a, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at io.reactivex.f.a$g.<clinit>(Schedulers.java:58)
at io.reactivex.f.a$h.call(Schedulers.java:1387)
at io.reactivex.e.a.a(RxJavaPlugins.java:1306)
at io.reactivex.f.a.<clinit>(Schedulers.java:2319)
at io.reactivex.f.a.a(Schedulers.java:341)
at com.kwai.a.a.<init>(Async.java:53)
at com.kwai.a.a.<init>(Async.java:21)
at com.kwai.a.a$a.<clinit>(Async.java:38)
at com.kwai.a.a.a(Async.java:1042)
at com.kuaishou.athena.storage.preference.a.<init>(BaseSharedPreferences.java:2039)
at com.kuaishou.athena.storage.preference.i.<init>(ProviderPreferences.java:25)
at com.kuaishou.athena.storage.preference.f.a(MultiProcessSharedPreferences.java:152)
at com.kuaishou.athena.storage.preference.f.<init>(MultiProcessSharedPreferences.java:29)
at com.kuaishou.athena.account.Account.e(Account.java:282)
at com.kuaishou.athena.account.CurrentUser.<init>(CurrentUser.java:32)
at com.kuaishou.athena.init.module.PreferenceInitModule.a(PreferenceInitModule.java:74)
at com.kuaishou.athena.KwaiAppLike.onBaseContextAttached(KwaiAppLike.java:2122)
at java.lang.reflect.Method.invoke(Native Method)
at com.tencent.tinker.loader.app.TinkerApplication.invokeAppLikeOnBaseContextAttached(TinkerApplication.java:131)
at com.tencent.tinker.loader.app.TinkerApplication.onBaseContextAttached(TinkerApplication.java:148)
at com.tencent.tinker.loader.app.TinkerApplication.attachBaseContext(TinkerApplication.java:164)
at android.app.Application.attach(Application.java:215)
at android.app.Instrumentation.newApplication(Instrumentation.java:1122)
at android.app.LoadedApk.makeApplication(LoadedApk.java:1065)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5920)
at android.app.ActivityThread.access$1200(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
看样子是主dex没有这个io.reactivex.internal.schedulers.j类,但是打release包的时候有配置主dex的列表,其中有io/reactivex/internal/**/class
,查看apk的classes.dex,也是存在的 @tomystang
io.reactivex.f.a$g.
方便的话把有问题的新apk也发到yinshengtang92@gmail.com吧。
是直接new的io.reactivex.internal.schedulers.j
,非数组类型或者注解类型。基准包,新包,补丁都邮件发给你了,谢谢帮助@tomystang
@tomystang 想咨询个问题,直接用assembleRelease的包可以安装,用Tinker的tinkerPatchRelease的包就不能安装,Tinker对assembleRelease做了什么修改么?
发下安装失败的提示?
运行之后crash的问题找到了,原因跟 #711 一样,都是某个dex中的clinit方法因为proguard的原因缺少V()这个proto定义导致的,dex2oat的log里能看到这句:
dex2oat : Failed to open dex file from oat file. File: base.apk!classes2.dex Error: Failure to verify dex file 'base.apk!classes2.dex':
must have descriptor ()V
参考那个issue里的解法就可以了。
@tomystang 按照711的方式已经可以,但是又出现了新的问题,跟 #638的一样,奇怪的时候补丁竟然可以应用成功。
Failed to add image file Failed to flatten class loader hierarchy 'Unknown class loader type com.tencent.tinker.loader.AndroidNClassLoader'
2019-05-07 15:56:21.040 23348-23348/? I/earl:messagesd: Failed to add image file Failed to flatten class loader hierarchy 'Unknown class loader type com.tencent.tinker.loader.AndroidNClassLoader'
2019-05-07 15:56:21.344 23262-23470/? I/p.android.pear: at java.lang.Class com.tencent.tinker.loader.AndroidNClassLoader.findClass(java.lang.String) (AndroidNClassLoader.java:194)
2019-05-07 15:56:21.344 23262-23470/? I/p.android.pear: at java.lang.Class com.tencent.tinker.loader.AndroidNClassLoader.findClass(java.lang.String) (AndroidNClassLoader.java:200)
2019-05-07 15:56:21.344 23262-23470/? I/p.android.pear: at java.lang.Class com.tencent.tinker.loader.AndroidNClassLoader.findClass(java.lang.String) (AndroidNClassLoader.java:194)
2019-05-07 15:56:21.345 23262-23470/? I/p.android.pear: at java.lang.Class com.tencent.tinker.loader.AndroidNClassLoader.findClass(java.lang.String) (AndroidNClassLoader.java:194)
2019-05-07 15:56:21.345 23262-23470/? I/p.android.pear: at java.lang.Class com.tencent.tinker.loader.AndroidNClassLoader.findClass(java.lang.String) (AndroidNClassLoader.java:200)
2019-05-07 15:56:21.345 23262-23470/? I/p.android.pear: at java.lang.Class com.tencent.tinker.loader.AndroidNClassLoader.findClass(java.lang.String) (AndroidNClassLoader.java:194)
2019-05-07 15:56:21.346 23262-23470/? I/p.android.pear: at java.lang.Class com.tencent.tinker.loader.AndroidNClassLoader.findClass(java.lang.String) (AndroidNClassLoader.java:194)
2019-05-07 15:56:21.346 23262-23470/? I/p.android.pear: at java.lang.Class com.tencent.tinker.loader.AndroidNClassLoader.findClass(java.lang.String) (AndroidNClassLoader.java:200)
2019-05-07 15:56:21.346 23262-23470/? I/p.android.pear: at java.lang.Class com.tencent.tinker.loader.AndroidNClassLoader.findClass(java.lang.String) (AndroidNClassLoader.java:194)
2019-05-07 15:56:21.346 23262-23470/? I/p.android.pear: at java.lang.Class com.tencent.tinker.loader.AndroidNClassLoader.findClass(java.lang.String) (AndroidNClassLoader.java:194)
2019-05-07 15:56:21.346 23262-23470/? I/p.android.pear: at java.lang.Class com.tencent.tinker.loader.AndroidNClassLoader.findClass(java.lang.String) (AndroidNClassLoader.java:200)
这个问题跟 #638 还不太一样,那边是因为ApplicationLike没做隔离导致的,1.9.9和1.9.13已经把ApplicationLike和TinkerApplication用反射隔离了,所以补丁加载应该是没问题的,但是Android 9.0不认识Tinker自定义的ClassLoader,所以就无法对补丁dex产生art缓存文件,并且会打log。