Tencent / tinker

Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstall apk.
Other
17.1k stars 3.33k forks source link

TinkerPatch过程异常TinkerPatchException:There are fatal reasons that cause Tinker interrupt patch generating procedure, see logs above. #1546

Open zhangdepeng125 opened 3 years ago

zhangdepeng125 commented 3 years ago

异常类型:tinkerPatch 打补丁包时异常

tinker版本:如:1.9.14.11 、1.9.14.13、1.9.14.14

gradle版本:如:3.4.2 、6.1.1、6.5

是否使用热更新SDK: 如 TinkerPatch SDK

系统:如:Windows

是 tinker-patch-gradle-lib 模块 中的 DexDiffDecoder 类的 375 行 image

抛出的异常。把该处代码注释掉 之后即可正常生成补丁包并能成功生效

堆栈/日志: FATAL: method 'onInit:VLIL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager$AttrTranslator;' refers to class 'Lorg/xmlpull/v1/XmlPullParser;' which is not loader class, this may cause crash when patch is loaded. FATAL: method 'translate:VLILL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager$AttrTranslator;' refers to class 'Lorg/xmlpull/v1/XmlPullParser;' which is not loader class, this may cause crash when patch is loaded. FATAL: method 'translate:VLILL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager$AttrTranslator;' refers to method 'getAttributeCount:I' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'translate:VLILL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager$AttrTranslator;' refers to method 'getAttributePrefix:LI' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'translate:VLILL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager$AttrTranslator;' refers to method 'getAttributeName:LI' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'translate:VLILL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager$AttrTranslator;' refers to method 'getAttributeValue:LI' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'init:ZLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'setInput:VL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'init:ZLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getEventType:I' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'init:ZLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getName:L' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'init:ZLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'next:I' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'init:ZLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'setInput:VL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'init:ZLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'setInput:VL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseActivity:LLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to class 'Lorg/xmlpull/v1/XmlPullParser;' which is not loader class, this may cause crash when patch is loaded. FATAL: method 'parseActivity:LLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getDepth:I' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseActivity:LLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'next:I' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseActivity:LLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getDepth:I' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseActivity:LLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getName:L' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to class 'Lorg/xmlpull/v1/XmlPullParser;' which is not loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getAttributeValue:LLL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getAttributeValue:LLL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getDepth:I' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'next:I' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getDepth:I' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getName:L' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getAttributeValue:LLL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getAttributeValue:LLL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getAttributeValue:LLL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to class 'Lorg/xmlpull/v1/XmlPullParserException;' which is not loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method ':VLLL' in class 'Lorg/xmlpull/v1/XmlPullParserException;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getAttributeValue:LLL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getAttributeValue:LLL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getAttributeValue:LLL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getAttributeValue:LLL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getAttributeValue:LLL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getAttributeValue:LLL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getAttributeValue:LLL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getAttributeValue:LLL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseIntentFilter:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getAttributeValue:LLL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseMetaData:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to class 'Lorg/xmlpull/v1/XmlPullParser;' which is not loader class, this may cause crash when patch is loaded. FATAL: method 'parseMetaData:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getAttributeValue:LLL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'parseMetaData:VLLL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getAttributeValue:LLL' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'skipCurrentTag:VL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to class 'Lorg/xmlpull/v1/XmlPullParser;' which is not loader class, this may cause crash when patch is loaded. FATAL: method 'skipCurrentTag:VL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getDepth:I' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'skipCurrentTag:VL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'next:I' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'skipCurrentTag:VL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager;' refers to method 'getDepth:I' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'onInit:VLIL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager$1;' refers to class 'Lorg/xmlpull/v1/XmlPullParser;' which is not loader class, this may cause crash when patch is loaded. FATAL: method 'onInit:VLIL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager$1;' refers to method 'getEventType:I' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'onInit:VLIL' in loader class 'Lcom/tencent/tinker/loader/hotplug/IncrementComponentManager$1;' refers to method 'getName:L' in class 'Lorg/xmlpull/v1/XmlPullParser;' which is not in loader class, this may cause crash when patch is loaded. Check if loader classes in classes7.dex refer to any classes that is not in loader class patterns.

Task :app:tinkerPatchCwgx_pRelease FAILED

Execution failed for task ':app:tinkerPatchCwgx_pRelease'.

com.tencent.tinker.build.util.TinkerPatchException: There are fatal reasons that cause Tinker interrupt patch generating procedure, see logs above.

lcl6 commented 3 years ago

解决了吗

zhangdepeng125 commented 3 years ago

解决了吗

解决了,下载源码,注释掉 tinker-patch-lib 模块下 DexDiffDecoder 类的第375-378 行,然后自己 发布到仓库,然后依赖自己的 tinker-patch 插件 image

vincecarterhu commented 2 years ago

解决了吗

解决了,下载源码,注释掉 tinker-patch-lib 模块下 DexDiffDecoder 类的第375-378 行,然后自己 发布到仓库,然后依赖自己的 tinker-patch 插件 image

治标不治本,注释了,加载差异包还是报错了

SoySauce1024 commented 2 years ago

解决了吗

解决了,下载源码,注释掉 tinker-patch-lib 模块下 DexDiffDecoder 类的第375-378 行,然后自己 发布到仓库,然后依赖自己的 tinker-patch 插件 image

治标不治本,注释了,加载差异包还是报错了

同样的问题 ,求助一波,大佬后面解决了吗

mjnhmd commented 2 years ago

解决了吗

解决了,下载源码,注释掉 tinker-patch-lib 模块下 DexDiffDecoder 类的第375-378 行,然后自己 发布到仓库,然后依赖自己的 tinker-patch 插件 image

治标不治本,注释了,加载差异包还是报错了

同样的问题 ,求助一波,大佬后面解决了吗

解决了,就用的这种方式

SoySauce1024 commented 2 years ago

解决了吗

解决了,下载源码,注释掉 tinker-patch-lib 模块下 DexDiffDecoder 类的第375-378 行,然后自己 发布到仓库,然后依赖自己的 tinker-patch 插件 image

治标不治本,注释了,加载差异包还是报错了

同样的问题 ,求助一波,大佬后面解决了吗

解决了,就用的这种方式

哦哦 好的,谢谢,如果使用 bugly 接入是不是没法改了 ,bugly 好像没有开源 tinker-support 这个插件的源码

mjnhmd commented 2 years ago

解决了吗

解决了,下载源码,注释掉 tinker-patch-lib 模块下 DexDiffDecoder 类的第375-378 行,然后自己 发布到仓库,然后依赖自己的 tinker-patch 插件 image

治标不治本,注释了,加载差异包还是报错了

同样的问题 ,求助一波,大佬后面解决了吗

解决了,就用的这种方式

哦哦 好的,谢谢,如果使用 bugly 接入是不是没法改了 ,bugly 好像没有开源 tinker-support 这个插件的源码

嗯,我是直接用的tinker

SoySauce1024 commented 2 years ago

解决了吗

解决了,下载源码,注释掉 tinker-patch-lib 模块下 DexDiffDecoder 类的第375-378 行,然后自己 发布到仓库,然后依赖自己的 tinker-patch 插件 image

治标不治本,注释了,加载差异包还是报错了

同样的问题 ,求助一波,大佬后面解决了吗

解决了,就用的这种方式

哦哦 好的,谢谢,如果使用 bugly 接入是不是没法改了 ,bugly 好像没有开源 tinker-support 这个插件的源码

嗯,我是直接用的tinker

好的 非常感谢!

jiyuren commented 2 years ago

刚试了一个方法,就是不要在 TinkerApplication 的子类里写方法,什么方法都不要写,把方法全部写在DefaultApplicationLike的子类里,就不会出现 which is not loader class, this may cause crash when patch is loaded 这个错误了 QQ截图20220415160117 主要根据这位兄弟的代码测出来的 https://github.com/shaycormac/BuglyHotfixDemo

abcdqianlei1990 commented 1 year ago

我这个问题是因为未开启混淆导致的,开启混淆后能打出补丁包了

shanlinli commented 1 year ago

打补丁包的时候,会检查loader相关的类有没有调用其他类的方法,loader相关类有gradle里配置的正则表达式的类和androidmanifest中配置的application类,gradle里面可以加自己的类,但是最好不要,相互引用,混淆,都是问题。这样做的目的是因为虚拟机类加载的原理,也是tinker修复java的核心原理导致的

liangyongchen commented 1 year ago

我这个问题是因为未开启混淆导致的,开启混淆后能打出补丁包了

我这边是开启混淆还是报错