使用bugly SDK进行热更新,补丁应用成功,但重启APP时抛出tinker load exception,界面卡死在启动页
异常类型:app运行时异常
手机型号:OPPO R17
手机系统版本:android 10 , ColorOS 7.1
tinker版本:如:1.9.9
gradle版本:如:3.4.3
是否使用热更新SDK: Bugly SDK
系统:Windows 10
堆栈/日志: 2022-04-19 15:27:22.885 26476-26476/? W/Tinker.TinkerLoader: tryLoadPatchFiles:patch dir not exist:/data/user/0/cn.xiaoyu.quanyika/tinker 2022-04-19 15:27:22.888 26476-26476/? I/Tinker.TinkerPatchListener: application maxMemory:384 2022-04-19 15:27:22.890 26476-26476/? W/Tinker.Tinker: tinker patch directory: /data/user/0/cn.xiaoyu.quanyika/tinker 2022-04-19 15:27:22.890 26476-26476/? I/Tinker.Tinker: try to install tinker, isEnable: true, version: 1.9.9 2022-04-19 15:27:22.890 26476-26476/? I/Tinker.TinkerLoadResult: parseTinkerResult loadCode:-2, process name:cn.xiaoyu.quanyika, main process:true, systemOTA:false, fingerPrint:OPPO/PBEM00/PBEM00:10/QKQ1.190918.001/2021060001:user/release-keys, oatDir:null, useInterpretMode:false 2022-04-19 15:27:22.890 26476-26476/? W/Tinker.TinkerLoadResult: can't find patch file, is ok, just return 2022-04-19 15:27:22.890 26476-26476/? I/Tinker.DefaultLoadReporter: patch loadReporter onLoadResult: patch load result, path:/data/user/0/cn.xiaoyu.quanyika/tinker, code: -2, cost: 2ms 2022-04-19 15:27:22.891 26476-26476/? W/Tinker.Tinker: tinker load fail! 2022-04-19 15:27:22.968 26476-26476/? I/Tinker.ComponentHotplug: method install() is not invoked, ignore ensuring operations. 2022-04-19 15:27:23.948 26476-26476/? W/Tinker.UpgradePatchRetry: onPatchRetryLoad retry info not exist, just return 2022-04-19 15:27:27.031 26476-26476/? I/Tinker.TinkerPatchListener: receive a patch file: /data/user/0/cn.xiaoyu.quanyika/app_tmpPatch/tmpPatch.apk, file size:15180 2022-04-19 15:27:27.033 26476-26476/? W/Tinker.UpgradePatchRetry: onPatchListenerCheck retry file is not exist, just return 2022-04-19 15:27:27.034 26476-26476/? I/Tinker.TinkerPatchListener: get platform:null 2022-04-19 15:27:27.034 26476-26476/? I/Tinker.TinkerPatchService: run patch service by job scheduler. 2022-04-19 15:27:27.168 26740-26740/? W/Tinker.TinkerLoader: tryLoadPatchFiles: we don't load patch with :patch process itself, just return 2022-04-19 15:27:27.172 26740-26740/? I/Tinker.TinkerPatchListener: application maxMemory:384 2022-04-19 15:27:27.174 26740-26740/? W/Tinker.Tinker: tinker patch directory: /data/user/0/cn.xiaoyu.quanyika/tinker 2022-04-19 15:27:27.174 26740-26740/? I/Tinker.Tinker: try to install tinker, isEnable: true, version: 1.9.9 2022-04-19 15:27:27.174 26740-26740/? I/Tinker.TinkerLoadResult: parseTinkerResult loadCode:-1, process name:cn.xiaoyu.quanyika:patch, main process:false, systemOTA:false, fingerPrint:OPPO/PBEM00/PBEM00:10/QKQ1.190918.001/2021060001:user/release-keys, oatDir:null, useInterpretMode:false 2022-04-19 15:27:27.174 26740-26740/? W/Tinker.TinkerLoadResult: tinker is disable, just return 2022-04-19 15:27:27.174 26740-26740/? I/Tinker.DefaultLoadReporter: patch loadReporter onLoadResult: patch load result, path:/data/user/0/cn.xiaoyu.quanyika/tinker, code: -1, cost: 2ms 2022-04-19 15:27:27.174 26740-26740/? W/Tinker.Tinker: tinker load fail! 2022-04-19 15:27:27.175 26740-26740/? I/Tinker.ComponentHotplug: method install() is not invoked, ignore ensuring operations. 2022-04-19 15:27:27.315 26740-26740/? W/Tinker.UpgradePatchRetry: onPatchRetryLoad retry is not main process, just return 2022-04-19 15:27:27.319 26740-26791/? I/Tinker.DefaultPatchReporter: patchReporter onPatchServiceStart: patch service start 2022-04-19 15:27:27.320 26740-26791/? W/Tinker.UpgradePatchRetry: try copy file: /data/user/0/cn.xiaoyu.quanyika/app_tmpPatch/tmpPatch.apk to /data/user/0/cn.xiaoyu.quanyika/tinker_temp/temp.apk 2022-04-19 15:27:27.358 26740-26791/? I/Tinker.UpgradePatch: UpgradePatch tryPatch:patchMd5:aef0b16c6c043d6de9912cddcf85905a 2022-04-19 15:27:27.360 26740-26791/? W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/cn.xiaoyu.quanyika/tinker/patch.info: open failed: ENOENT (No such file or directory) 2022-04-19 15:27:27.360 26740-26791/? W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/cn.xiaoyu.quanyika/tinker/patch.info: open failed: ENOENT (No such file or directory) 2022-04-19 15:27:27.361 26740-26791/? I/Tinker.UpgradePatch: UpgradePatch tryPatch:patchVersionDirectory:/data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c 2022-04-19 15:27:27.365 26740-26791/? W/Tinker.UpgradePatch: UpgradePatch copy patch file, src file: /data/user/0/cn.xiaoyu.quanyika/app_tmpPatch/tmpPatch.apk size: 15180, dest file: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/patch-aef0b16c.apk size:15180 2022-04-19 15:27:32.039 26476-26476/? I/Tinker.TinkerPatchService: check if patch service is running. 2022-04-19 15:27:33.235 26740-26791/? W/Tinker.DexDiffPatchInternal: success recover dex file: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/classes.dex.jar, size: 3942047, use time: 5865 2022-04-19 15:27:37.241 26740-26791/? W/Tinker.DexDiffPatchInternal: success recover dex file: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/classes2.dex.jar, size: 3676796, use time: 4006 2022-04-19 15:27:37.242 26740-26791/? I/Tinker.DexDiffPatchInternal: try Extracting /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/classes3.dex.jar 2022-04-19 15:27:39.519 26740-26791/? I/Tinker.DexDiffPatchInternal: isExtractionSuccessful: true 2022-04-19 15:27:39.645 26740-26791/? I/Tinker.DexDiffPatchInternal: try Extracting /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/classes4.dex.jar 2022-04-19 15:27:40.200 27391-27391/? W/Tinker.TinkerLoader: tryLoadPatchFiles:patch info not exist:/data/user/0/cn.xiaoyu.quanyika/tinker/patch.info 2022-04-19 15:27:40.204 27391-27391/? I/Tinker.TinkerPatchListener: application maxMemory:384 2022-04-19 15:27:40.206 27391-27391/? W/Tinker.Tinker: tinker patch directory: /data/user/0/cn.xiaoyu.quanyika/tinker 2022-04-19 15:27:40.206 27391-27391/? I/Tinker.Tinker: try to install tinker, isEnable: true, version: 1.9.9 2022-04-19 15:27:40.207 27391-27391/? I/Tinker.TinkerLoadResult: parseTinkerResult loadCode:-3, process name:cn.xiaoyu.quanyika:channel, main process:false, systemOTA:false, fingerPrint:OPPO/PBEM00/PBEM00:10/QKQ1.190918.001/2021060001:user/release-keys, oatDir:null, useInterpretMode:false 2022-04-19 15:27:40.207 27391-27391/? W/Tinker.TinkerLoadResult: can't find patch file, is ok, just return 2022-04-19 15:27:40.207 27391-27391/? I/Tinker.DefaultLoadReporter: patch loadReporter onLoadResult: patch load result, path:/data/user/0/cn.xiaoyu.quanyika/tinker, code: -3, cost: 2ms 2022-04-19 15:27:40.207 27391-27391/? W/Tinker.Tinker: tinker load fail! 2022-04-19 15:27:40.208 27391-27391/? I/Tinker.ComponentHotplug: method install() is not invoked, ignore ensuring operations. 2022-04-19 15:27:40.478 27391-27391/? W/Tinker.UpgradePatchRetry: onPatchRetryLoad retry is not main process, just return 2022-04-19 15:27:42.006 26740-26791/? I/Tinker.DexDiffPatchInternal: isExtractionSuccessful: true 2022-04-19 15:27:42.127 26740-26791/? I/Tinker.DexDiffPatchInternal: try Extracting /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/classes5.dex.jar 2022-04-19 15:27:42.593 26740-26791/? I/Tinker.DexDiffPatchInternal: isExtractionSuccessful: true 2022-04-19 15:27:42.624 26740-26791/? I/Tinker.DexDiffPatchInternal: try Extracting /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/test.dex.jar 2022-04-19 15:27:42.627 26740-26791/? I/Tinker.DexDiffPatchInternal: isExtractionSuccessful: true 2022-04-19 15:27:43.255 26740-26791/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/test.dex.jar 2022-04-19 15:27:43.256 26740-26791/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/classes3.dex.jar 2022-04-19 15:27:43.259 26740-26791/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/classes2.dex.jar 2022-04-19 15:27:43.262 26740-26791/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/classes4.dex.jar 2022-04-19 15:27:43.282 26740-26791/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/classes.dex.jar 2022-04-19 15:27:43.286 26740-26791/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/classes5.dex.jar 2022-04-19 15:27:43.287 26740-26791/? I/Tinker.DexDiffPatchInternal: merge classN dex file /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/tinker_classN.apk, result: true, size: 15732449, use: 660ms 2022-04-19 15:27:43.288 26740-26791/? I/Tinker.DexDiffPatchInternal: legal files to do dexopt: [/data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/tinker_classN.apk] 2022-04-19 15:27:43.290 26740-26791/? I/Tinker.DexDiffPatchInternal: patch recover, try to optimize dex file count:1, optimizeDexDirectory:/data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/odex/ 2022-04-19 15:27:43.291 26740-26791/? I/Tinker.DexDiffPatchInternal: start to parallel optimize dex /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/tinker_classN.apk, size: 15732449 2022-04-19 15:27:45.418 26740-26791/? I/Tinker.DexDiffPatchInternal: success to parallel optimize dex /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/tinker_classN.apk, opt file:/data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/oat/arm64/tinker_classN.odex, opt file size: 0, use time 2127 2022-04-19 15:27:45.418 26740-26791/? I/Tinker.DexDiffPatchInternal: recover dex result:true, cost:18052 2022-04-19 15:27:45.419 26740-26791/? W/Tinker.BsDiffPatchInternal: patch recover, library is not contained 2022-04-19 15:27:45.419 26740-26791/? W/Tinker.ResDiffPatchInternal: patch recover, resource is not contained 2022-04-19 15:27:45.419 26740-26791/? I/Tinker.DexDiffPatchInternal: raw dex count: 6, dex opt dex count: 1, final wait times: 120 2022-04-19 15:27:45.438 26740-26791/? I/Tinker.DexDiffPatchInternal: check dex optimizer file exist: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/oat/arm64/tinker_classN.odex, size 0 2022-04-19 15:27:45.439 26740-26791/? I/Tinker.PatchInfo: rewritePatchInfoFile file path:/data/user/0/cn.xiaoyu.quanyika/tinker/patch.info , oldVer:, newVer:aef0b16c6c043d6de9912cddcf85905a, fingerprint:OPPO/PBEM00/PBEM00:10/QKQ1.190918.001/2021060001:user/release-keys, oatDir:odex 2022-04-19 15:27:45.442 26740-26791/? W/Tinker.UpgradePatch: UpgradePatch tryPatch: done, it is ok 2022-04-19 15:27:45.442 26740-26791/? I/Tinker.DefaultPatchReporter: patchReporter onPatchResult: patch all result path: /data/user/0/cn.xiaoyu.quanyika/app_tmpPatch/tmpPatch.apk, success: true, cost: 18115 2022-04-19 15:27:45.443 26740-26791/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker_temp/temp.apk 2022-04-19 15:27:45.491 26476-27588/? I/Tinker.TinkerResultService: TinkerResultService receive result: PatchResult: isSuccess:true rawPatchFilePath:/data/user/0/cn.xiaoyu.quanyika/app_tmpPatch/tmpPatch.apk costTime:18115 patchVersion:aef0b16c6c043d6de9912cddcf85905a 2022-04-19 15:27:45.499 26476-27588/? W/Tinker.DefaultTinkerResultService: deleteRawPatchFile rawFile path: /data/user/0/cn.xiaoyu.quanyika/app_tmpPatch/tmpPatch.apk 2022-04-19 15:27:45.499 26476-27588/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/app_tmpPatch/tmpPatch.apk 2022-04-19 15:27:45.499 26476-27588/? I/Tinker.TinkerResultService: tinker wait screen to restart process
-------------------------------到这里为止,补丁应用成功-------------------------------------------- 然后重新启动APP时报错,界面卡死在启动页,日志如下: 2022-04-19 15:29:28.457 27760-27760/? W/Tinker.TinkerLoader: tryLoadPatchFiles:isEnabledForResource:true 2022-04-19 15:29:28.457 27760-27760/? I/Tinker.PatchInfo: rewritePatchInfoFile file path:/data/user/0/cn.xiaoyu.quanyika/tinker/patch.info , oldVer:aef0b16c6c043d6de9912cddcf85905a, newVer:aef0b16c6c043d6de9912cddcf85905a, fingerprint:OPPO/PBEM00/PBEM00:10/QKQ1.190918.001/2021060001:user/release-keys, oatDir:odex 2022-04-19 15:29:28.459 27760-27760/? I/Tinker.TinkerLoader: tryLoadPatchFiles:success to rewrite patch info, kill other process. 2022-04-19 15:29:28.461 27760-27760/? W/Tinker.TinkerInternals: getSafeModeCount: preferName:tinker_own_config_cn.xiaoyu.quanyika count:0 2022-04-19 15:29:28.466 27760-27760/? W/Tinker.TinkerInternals: setSafeModeCount: preferName:tinker_own_config_cn.xiaoyu.quanyika count:1 2022-04-19 15:29:28.466 27760-27760/? I/Tinker.TinkerDexLoader: classloader: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/cn.xiaoyu.quanyika-Re-DNzeqG-6XnygTkhJH9w==/base.apk"],nativeLibraryDirectories=[/data/app/cn.xiaoyu.quanyika-Re-DNzeqG-6XnygTkhJH9w==/lib/arm64, /data/app/cn.xiaoyu.quanyika-Re-DNzeqG-6XnygTkhJH9w==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]]] 2022-04-19 15:29:28.466 27760-27760/? I/Tinker.TinkerDexLoader: verify dex file:/data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/tinker_classN.apk md5, use time: 0 2022-04-19 15:29:28.466 27760-27760/? I/Tinker.ClassLoaderAdder: installDexes dexOptDir: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/odex, dex size:1 2022-04-19 15:29:28.467 27760-27760/? W/System: ClassLoader referenced unknown path: 2022-04-19 15:29:28.467 27760-27760/? W/xiaoyu.quanyik: Unsupported class loader 2022-04-19 15:29:28.469 27760-27760/? W/xiaoyu.quanyik: Skipping duplicate class check due to unsupported classloader 2022-04-19 15:29:28.471 27760-27760/? I/System: Opening DexFile: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/tinker_classN.apk 2022-04-19 15:29:28.471 27760-27760/? W/xiaoyu.quanyik: Opening an oat file without a class loader. Are you using the deprecated DexFile APIs? 2022-04-19 15:29:28.472 27760-27760/? W/xiaoyu.quanyik: Skipping duplicate class check due to unsupported classloader 2022-04-19 15:29:28.476 27760-27760/? I/Tinker.ClassLoaderAdder: after loaded classloader: com.tencent.tinker.loader.AndroidNClassLoader[DexPathList[[zip file "/data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/tinker_classN.apk", zip file "/data/app/cn.xiaoyu.quanyika-Re-DNzeqG-6XnygTkhJH9w==/base.apk"],nativeLibraryDirectories=[/data/app/cn.xiaoyu.quanyika-Re-DNzeqG-6XnygTkhJH9w==/lib/arm64, /data/app/cn.xiaoyu.quanyika-Re-DNzeqG-6XnygTkhJH9w==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]]], dex size:1 2022-04-19 15:29:28.476 27760-27760/? W/Tinker.ClassLoaderAdder: checkDexInstall result:false 2022-04-19 15:29:28.477 27760-27760/? E/Tinker.TinkerDexLoader: install dexes failed 2022-04-19 15:29:28.477 27760-27760/? W/Tinker.TinkerLoader: tryLoadPatchFiles:onPatchLoadDexesFail 2022-04-19 15:29:28.480 27760-27760/? I/MultiDex: VM with version 2.1.0 has multidex support 2022-04-19 15:29:28.480 27760-27760/? I/MultiDex: Installing application 2022-04-19 15:29:28.480 27760-27760/? I/MultiDex: VM has multidex support, MultiDex support library is disabled. 2022-04-19 15:29:28.483 27760-27760/? I/Tinker.TinkerPatchListener: application maxMemory:384 2022-04-19 15:29:28.485 27760-27760/? W/Tinker.Tinker: tinker patch directory: /data/user/0/cn.xiaoyu.quanyika/tinker 2022-04-19 15:29:28.486 27760-27760/? I/Tinker.Tinker: try to install tinker, isEnable: true, version: 1.9.9 2022-04-19 15:29:28.486 27760-27760/? I/Tinker.TinkerLoadResult: parseTinkerResult loadCode:-14, process name:cn.xiaoyu.quanyika, main process:true, systemOTA:false, fingerPrint:OPPO/PBEM00/PBEM00:10/QKQ1.190918.001/2021060001:user/release-keys, oatDir:odex, useInterpretMode:false 2022-04-19 15:29:28.486 27760-27760/? I/Tinker.TinkerLoadResult: parseTinkerResult oldVersion:, newVersion:aef0b16c6c043d6de9912cddcf85905a, current:aef0b16c6c043d6de9912cddcf85905a 2022-04-19 15:29:28.486 27760-27760/? I/Tinker.TinkerLoadResult: Tinker load have exception loadCode:-14 2022-04-19 15:29:28.486 27760-27760/? E/Tinker.DefaultLoadReporter: patch loadReporter onLoadException: tinker dex check fail:Tinker Exception:checkDexInstall failed 2022-04-19 15:29:28.487 3300-5884/? I/SafeCenter.DWB.zrk: 3 cache empty false {cn.xiaoyu.quanyika=AppStats{packageName='cn.xiaoyu.quanyika', totalTimeUsed=18068851, beginTime=1650303990464, endTime=1650305791225, bucketType=0, transformTime=1650353368433, bucketTime=1650297600000}, com.xingtong.kttest=AppStats{packageName='com.xingtong.kttest', totalTimeUsed=297975, beginTime=1650338400201, endTime=0, bucketType=1, transformTime=-1, bucketTime=1650297600000}, com.oppo.camera=AppStats{packageName='com.oppo.camera', totalTimeUsed=2083, beginTime=1650335418788, endTime=0, bucketType=1, transformTime=-1, bucketTime=1650297600000}, com.android.settings=AppStats{packageName='com.android.settings', totalTimeUsed=1171792, beginTime=1650351994216, endTime=0, bucketType=1, transformTime=-1, bucketTime=1650297600000}} 2022-04-19 15:29:28.493 27760-27760/? I/Tinker.DefaultLoadReporter: dex exception disable tinker forever with sp 2022-04-19 15:29:28.493 27760-27760/? E/Tinker.DefaultLoadReporter: tinker load exception, welcome to submit issue to us: https://github.com/Tencent/tinker/issues 2022-04-19 15:29:28.493 27760-27760/? E/Tinker.DefaultLoadReporter: tinker load exception com.tencent.tinker.loader.TinkerRuntimeException: Tinker Exception:checkDexInstall failed at com.tencent.tinker.loader.SystemClassLoaderAdder.installDexes(SystemClassLoaderAdder.java:84) at com.tencent.tinker.loader.TinkerDexLoader.loadTinkerJars(TinkerDexLoader.java:194) at com.tencent.tinker.loader.TinkerLoader.tryLoadPatchFilesInternal(TinkerLoader.java:263) at com.tencent.tinker.loader.TinkerLoader.tryLoad(TinkerLoader.java:58) at java.lang.reflect.Method.invoke(Native Method) at com.tencent.tinker.loader.app.TinkerApplication.loadTinker(TinkerApplication.java:161) at com.tencent.tinker.loader.app.TinkerApplication.onBaseContextAttached(TinkerApplication.java:134) at com.tencent.tinker.loader.app.TinkerApplication.attachBaseContext(TinkerApplication.java:152) at android.app.Application.attach(Application.java:359) at android.app.Instrumentation.newApplication(Instrumentation.java:1157) at android.app.LoadedApk.makeApplication(LoadedApk.java:1260) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6795) at android.app.ActivityThread.access$1700(ActivityThread.java:240) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2068) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:238) at android.app.ActivityThread.main(ActivityThread.java:7798) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:512) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995) 2022-04-19 15:29:28.494 27760-27760/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/info.lock 2022-04-19 15:29:28.494 27760-27760/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/patch-aef0b16c.apk 2022-04-19 15:29:28.494 27760-27760/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/oat/tinker_classN.apk.cur.prof 2022-04-19 15:29:28.494 27760-27760/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/oat/arm64/tinker_classN.odex 2022-04-19 15:29:28.494 27760-27760/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/oat/arm64/tinker_classN.vdex 2022-04-19 15:29:28.494 27760-27760/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/oat/arm64 2022-04-19 15:29:28.494 27760-27760/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/oat/tinker_classN.apk.prof 2022-04-19 15:29:28.494 27760-27760/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/oat 2022-04-19 15:29:28.495 27760-27760/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex/tinker_classN.apk 2022-04-19 15:29:28.499 27760-27760/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/dex 2022-04-19 15:29:28.499 27760-27760/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c/odex 2022-04-19 15:29:28.499 27760-27760/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch-aef0b16c 2022-04-19 15:29:28.499 27760-27760/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker/patch.info 2022-04-19 15:29:28.500 27760-27760/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/cn.xiaoyu.quanyika/tinker 2022-04-19 15:29:28.500 27760-27760/? I/Tinker.DefaultLoadReporter: patch loadReporter onLoadResult: patch load result, path:/data/user/0/cn.xiaoyu.quanyika/tinker, code: -14, cost: 39ms 2022-04-19 15:29:28.500 27760-27760/? W/Tinker.Tinker: tinker load fail!
---------------------------------------------贴出相关配置项代码,基本参照https://bugly.qq.com/docs/user-guide/instruction-manual-android-hotfix/?v=1.0.0来填写的------------------------------------------------------------ app module下的tinker-support.gradle `apply plugin: 'com.tencent.bugly.tinker-support'
def bakPath = file("${rootDir}/app/bakApk/")
/**
- 此处填写每次构建生成的基准包目录 */ def baseApkDir = "app-0419-14-18-12" def flavorsName = "baidu"
/**
-
对于插件各参数的详细解析请参考 */ tinkerSupport { supportHotplugComponent = true ignoreWarning = true // 开启tinker-support插件,默认值true enable = true
// 指定归档目录,默认值当前module的子目录tinker autoBackupApkDir = "${bakPath}"
// 是否启用覆盖tinkerPatch配置功能,默认值false // 开启后tinkerPatch配置不生效,即无需添加tinkerPatch overrideTinkerPatchConfiguration = true
// 编译补丁包时,必需指定基线版本的apk,默认值为空 // 如果为空,则表示不是进行补丁包的编译 // @{link tinkerPatch.oldApk } baseApk = "${bakPath}/${baseApkDir}/${flavorsName}/app-${flavorsName}-release.apk"
// 对应tinker插件applyMapping baseApkProguardMapping = "${bakPath}/${baseApkDir}/${flavorsName}/app-${flavorsName}-mapping.txt"
// 对应tinker插件applyResourceMapping baseApkResourceMapping = "${bakPath}/${baseApkDir}/${flavorsName}/app-${flavorsName}-release-R.txt"
// 构建基准包和补丁包都要指定不同的tinkerId,并且必须保证唯一性 tinkerId = "patch-20220419-test01" //tinkerId = "base-20220419-test01"
// 构建多渠道补丁时使用 buildAllFlavorsDir = "${bakPath}/${baseApkDir}"
// 是否启用加固模式,默认为false.(tinker-spport 1.0.7起支持) isProtectedApp = false
// 是否开启反射Application模式 enableProxyApplication = false
// 是否支持新增非export的Activity(注意:设置为true才能修改AndroidManifest文件) supportHotplugComponent = true
}
/**
-
一般来说,我们无需对下面的参数做任何的修改
-
对于各参数的详细介绍请参考:
-
https://github.com/Tencent/tinker/wiki/Tinker-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97 / tinkerPatch { //oldApk ="${bakPath}/${appName}/app-release.apk" ignoreWarning = true useSign = true dex { dexMode = "jar" pattern = ["classes.dex"] loader = ["com.tencent.tinker.loader.","com.cyl.xiaoyu.base.MyTinkerApplication"] } lib { pattern = ["lib//*.so"] }
res { pattern = ["res/", "r/", "assets/*", "resources.arsc", "AndroidManifest.xml"] ignoreChange = [] largeModSize = 100 }
packageConfig { } sevenZip { zipArtifact = "com.tencent.mm:SevenZip:1.1.10" // path = "/usr/local/bin/7za" } buildConfig { keepDexApply = false //tinkerId = "1.0.1-base" //applyMapping = "${bakPath}/${appName}/app-release-mapping.txt" // 可选,设置mapping文件,建议保持旧apk的proguard混淆方式 //applyResourceMapping = "${bakPath}/${appName}/app-release-R.txt" // 可选,设置R.txt文件,通过旧apk文件保持ResId的分配 } }`
项目目录下的build.gradle
buildscript{ ............ dependencies { ................... classpath 'com.android.tools.build:gradle:3.4.3' classpath "com.tencent.bugly:tinker-support:1.2.1" } }
app module目录下build.gradle
`apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply from: 'tinker-support.gradle'
android { compileSdkVersion 28 defaultConfig { ................... targetSdkVersion 28 flavorDimensions "versionCode" javaCompileOptions { annotationProcessorOptions { arguments = [ moduleName : project.getName() ] } } compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
ndk{
abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a'
}
multiDexEnabled true
}
packagingOptions { doNotStrip '/mips/.so' doNotStrip '/mips64/.so' exclude 'lib/arm64-v8a/libc++_shared.so' exclude 'lib/armeabi/libc++_shared.so' exclude 'lib/armeabi-v7a/libc++_shared.so' exclude 'lib/x86/libc++_shared.so' exclude 'lib/x86_64/libc++_shared.so' //2022-02-25因为修正oaid版本号添加 doNotStrip "/armeabi-v7a/.so" doNotStrip "/arm64-v8a/.so" doNotStrip "/x86_64/.so" doNotStrip "/x86/.so" } lintOptions { checkReleaseBuilds false abortOnError false } sourceSets { main { java.srcDirs = ['src/main/java'] jniLibs.srcDirs = ['libs'] res.srcDirs = ['src/main/res'] }
}
buildTypes { release { multiDexKeepFile file ('multidex-config.txt')// 小括号记得要加上,官方文档没有 minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.binfen } debug{ multiDexKeepFile file ('multidex-config.txt')// 小括号记得要加上,官方文档没有 minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.binfen
}
}
productFlavors {//渠道包处理
.......................
baidu {
manifestPlaceholders.put("UMENG_CHANNEL_VALUE","baidu")
}
}
compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }
dependencies { ............. implementation "com.android.support:multidex:1.0.1" // 多dex配置 //注释掉原有bugly的仓库 //compile 'com.tencent.bugly:crashreport:latest.release'//其中latest.release指代最新版本号,也可以指定明确的版本号,例如1.3.4 implementation 'com.tencent.bugly:crashreport_upgrade:1.3.6' // 指定tinker依赖版本(注:应用升级1.3.5版本起,不再内置tinker) implementation 'com.tencent.tinker:tinker-android-lib:1.9.9' implementation 'com.tencent.bugly:nativecrashreport:3.9.2' } `
multiDexKeepFile file ('multidex-config.txt')// 小括号记得要加上,官方文档没有 这个作用是什么?
multiDexKeepFile file ('multidex-config.txt')// 小括号记得要加上,官方文档没有 这个作用是什么? 加上这个是因为在尝试接入tinker的过程中,运行遇到错误:loader classes are found in old secondary dex,于是在全网搜索到了这样一篇文章,链接:](https://blog.csdn.net/ouwenlue/article/details/106851184) 通过该文章的内容,加入了multiDexKeepFile file ('multidex-config.txt'),运行确实不再报loader classes are found in old secondary dex这个错误
isProtectedApp = true 开启加固模式有用过吗?
isProtectedApp = true 开启加固模式有用过吗?
有,最早就开启了这个加固的,报同样的错误,于是就退而求其次,打算先进行未加固的测试,但现在未加固也是有报这个错误。 但我新建一个工程,用同样的代码逻辑来引入tinker,是能做到补丁正常下发,安装调试也都是OK的,只是放到实际项目中,内容要复杂很多,也集成了众多第三方的sdk,打包也有加固这些。
目前是还未开启加固,但有尝试过开启加固,开启与否现在都是会报错。
同遇到了,求解决方法