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

补丁包只生效一次 Tinker Exception:checkDexInstall failed #1699

Open lao-Driver opened 1 year ago

lao-Driver commented 1 year ago

Issue/提问须知

在提交issue之前,我们应该先查询是否已经有相关的issue以及常见问题。提交issue时,我们需要写明issue的原因,以及编译或运行过程的日志(加载进程以及Patch进程)。issue需要以下面的格式:

异常类型:app运行时异常

手机型号:如:荣耀10(如是编译异常,则可以不填)

手机系统版本:如:Android 10 (如是编译异常,则可以不填)

tinker版本:如:1.9.14.25.1

gradle版本:如:7.0.2

是否使用热更新SDK: 否

系统:如:window11

堆栈/日志:
1. 如是编译异常,请在执行gradle命令时,加上--stacktrace;
2. 日志我们需要过滤"Tinker."关键字;
3. 对于合成失败的情况,请给出:patch进程的日志,这里需要将Android Moniter右上角设为No Filter。

2022-12-01 14:42:08.100 3212-3239/? I/Tinker.PatchInfo: rewritePatchInfoFile file path:/data/user/0/com.hw.tinkerdemo/tinker/patch.info , oldVer:, newVer:bf1c39a6488824b450f905ca374c71b0, isProtectedApp:0, versionToRemove:, fingerprint:HONOR/COL-AL10/HWCOL:10/HUAWEICOL-AL10/10.0.0.179C00:user/release-keys, oatDir:odex, isRemoveInterpretOATDir:0, stack: java.lang.Throwable at com.tencent.tinker.loader.shareutil.SharePatchInfo.rewritePatchInfoFile(SharePatchInfo.java:184) at com.tencent.tinker.loader.shareutil.SharePatchInfo.rewritePatchInfoFileWithLock(SharePatchInfo.java:104) at com.tencent.tinker.lib.patch.UpgradePatch.tryPatch(UpgradePatch.java:196) at com.tencent.tinker.lib.service.TinkerPatchService.doApplyPatch(TinkerPatchService.java:223) at com.tencent.tinker.lib.service.TinkerPatchService.onHandleIntent(TinkerPatchService.java:101) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:213) at android.os.HandlerThread.run(HandlerThread.java:67) 2022-12-01 14:42:08.102 3212-3239/? I/Tinker.UpgradePatchRetry: onPatchResetMaxCheck, reset max check to 1

《---------------------------------------------------------------------------------------》

2022-12-01 14:42:23.989 3899-3899/? I/Tinker.TinkerDexLoader: classloader: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.hw.tinkerdemo-aj_AZQVYpsvUFW_Jl5HfFw==/base.apk"],nativeLibraryDirectories=[/data/app/com.hw.tinkerdemo-aj_AZQVYpsvUFW_Jl5HfFw==/lib/arm64, /system/lib64, /system/product/lib64, /hw_product/lib64, /system/product/lib64, /prets/lib64]]] 2022-12-01 14:42:23.989 3899-3899/? I/Tinker.TinkerDexLoader: verify dex file:/data/user/0/com.hw.tinkerdemo/tinker/patch-bf1c39a6/dex/tinker_classN.apk md5, use time: 0 2022-12-01 14:42:23.989 3899-3899/? I/Tinker.ClassLoaderAdder: installDexes dexOptDir: /data/user/0/com.hw.tinkerdemo/tinker/patch-bf1c39a6/odex, dex size:1 2022-12-01 14:42:23.993 3899-3899/? I/Tinker.ClassLoaderAdder: after loaded classloader: com.tencent.tinker.loader.TinkerClassLoader[DexPathList[[zip file "/data/user/0/com.hw.tinkerdemo/tinker/patch-bf1c39a6/dex/tinker_classN.apk"],nativeLibraryDirectories=[/data/app/com.hw.tinkerdemo-aj_AZQVYpsvUFW_Jl5HfFw==/lib/arm64, /system/lib64, /system/product/lib64, /hw_product/lib64, /system/product/lib64, /prets/lib64]]], dex size:1 2022-12-01 14:42:23.993 3899-3899/? I/Tinker.ClassLoaderAdder: checkDexInstall result: false, checker_classloader: com.tencent.tinker.loader.TinkerClassLoader[DexPathList[[zip file "/data/user/0/com.hw.tinkerdemo/tinker/patch-bf1c39a6/dex/tinker_classN.apk"],nativeLibraryDirectories=[/data/app/com.hw.tinkerdemo-aj_AZQVYpsvUFW_Jl5HfFw==/lib/arm64, /system/lib64, /system/product/lib64, /hw_product/lib64, /system/product/lib64, /prets/lib64]]] 2022-12-01 14:42:23.994 3899-3899/? E/Tinker.TinkerDexLoader: install dexes failed 2022-12-01 14:42:23.994 3899-3899/? W/Tinker.TinkerLoader: tryLoadPatchFiles:onPatchLoadDexesFail 2022-12-01 14:42:23.998 3899-3899/? D/Tinker.DefaultAppLike: onBaseContextAttached: 2022-12-01 14:42:24.010 3899-3899/? V/Tinker.SamplePatchListener: application maxMemory:384 2022-12-01 14:42:24.015 3899-3899/? W/Tinker.Tinker: tinker patch directory: /data/user/0/com.hw.tinkerdemo/tinker 2022-12-01 14:42:24.017 3899-3899/? I/Tinker.Tinker: try to install tinker, isEnable: true, version: 1.9.14.25.1 2022-12-01 14:42:24.018 3899-3899/? I/Tinker.TinkerLoadResult: parseTinkerResult loadCode:-14, process name:com.hw.tinkerdemo, main process:true, systemOTA:false, fingerPrint:HONOR/COL-AL10/HWCOL:10/HUAWEICOL-AL10/10.0.0.179C00:user/release-keys, oatDir:odex, useInterpretMode:false 2022-12-01 14:42:24.018 3899-3899/? I/Tinker.TinkerLoadResult: parseTinkerResult oldVersion:, newVersion:bf1c39a6488824b450f905ca374c71b0, current:bf1c39a6488824b450f905ca374c71b0 2022-12-01 14:42:24.019 3899-3899/? I/Tinker.TinkerLoadResult: Tinker load have exception loadCode:-14 2022-12-01 14:42:24.019 3899-3899/? E/Tinker.DefaultLoadReporter: patch loadReporter onLoadException: tinker dex check fail:Tinker Exception:checkDexInstall failed

《-----------------------------------------------------------------------------------------------------》 2022-12-01 14:42:24.024 3899-3899/? E/Tinker.DefaultLoadReporter: tinker load exception com.tencent.tinker.loader.TinkerRuntimeException: Tinker Exception:checkDexInstall failed at com.tencent.tinker.loader.SystemClassLoaderAdder.installDexes(SystemClassLoaderAdder.java:73) at com.tencent.tinker.loader.TinkerDexLoader.loadTinkerJars(TinkerDexLoader.java:191) at com.tencent.tinker.loader.TinkerLoader.tryLoadPatchFilesInternal(TinkerLoader.java:346) at com.tencent.tinker.loader.TinkerLoader.tryLoad(TinkerLoader.java:57) at java.lang.reflect.Method.invoke(Native Method) at com.tencent.tinker.loader.app.TinkerApplication.loadTinker(TinkerApplication.java:125) at com.tencent.tinker.loader.app.TinkerApplication.onBaseContextAttached(TinkerApplication.java:163) at com.tencent.tinker.loader.app.TinkerApplication.attachBaseContext(TinkerApplication.java:186) at android.app.Application.attach(Application.java:358) at android.app.Instrumentation.newApplication(Instrumentation.java:1161) at android.app.LoadedApk.makeApplication(LoadedApk.java:1296) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7173) at android.app.ActivityThread.access$2200(ActivityThread.java:296) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2208) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:8178) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)

提问题时若使用不能用/没效果/有问题/报错此类模糊表达,但又没给出任何代码截图报错的,将绝对不会有任何反馈。这种issue也是一律直接关闭的,大家可以参阅提问的智慧

Tinker是一个开源项目,希望大家遇到问题时要学会先思考,看看sample与Tinker的源码,更鼓励大家给我们提pr.

pengyongshun commented 1 year ago

我也遇到了,补丁生效一次后,在推出app,杀死进程,再进去,结果就失效了

EKALEB commented 1 year ago

我也遇到了,补丁生效一次后,在推出app,杀死进程,再进去,结果就失效了

+1

GitHubWebb commented 1 year ago

+1 不过,换个版本再换回来就好了,时好时坏

九天

@.*** |

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2023年01月11日 17:06 | | 收件人 | @.> | | 抄送至 | @.***> | | 主题 | Re: [Tencent/tinker] 补丁包只生效一次 Tinker Exception:checkDexInstall failed (Issue #1699) |

我也遇到了,补丁生效一次后,在推出app,杀死进程,再进去,结果就失效了

+1

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>