Open alex-wei opened 5 years ago
如果app的Application必须继承一个父Application,且Flutter的sdk也要求app的Application必须为他指定的父Application,那暂时是无法集成Tinker的。否则把原来的Application里的逻辑放到一个你自己新建的ApplicationLike类里,然后在这个ApplicationLike的注解里按demo的做法配置一下就可以了。
Flutter moudle没有要求Application必须继承flutter的Application。我使用的是继承flutterActivity,所以对Application没影响。 按照之前的正常使用即可。 我已经在项目中使用了。而且也发了一次补丁,补丁也成功了。 建议楼主试一下。
使用flutter create abc 方式创建的项目,热更新提示成功了,重启之后就是不显示更新之后的内容,愁死个人,哪位大佬帮忙指点一下,谢谢 下面是日志: W/Tinker.TinkerLoader: tryLoadPatchFiles:patch dir not exist:/data/user/0/com.upgrade.example.upgrade_demo/tinker D/Tinker.DefaultAppLike: onBaseContextAttached: I/Tinker.TinkerPatchListener: application maxMemory:256 W/Tinker.Tinker: tinker patch directory: /data/user/0/com.upgrade.example.upgrade_demo/tinker I/Tinker.Tinker: try to install tinker, isEnable: true, version: 1.9.13.2 I/Tinker.TinkerLoadResult: parseTinkerResult loadCode:-2, process name:com.upgrade.example.upgrade_demo, main process:true, systemOTA:false, fingerPrint:Xiaomi/capricorn/capricorn:8.0.0/OPR1.170623.032/V10.2.2.0.OAGCNXM:user/release-keys, oatDir:null, useInterpretMode:false W/Tinker.TinkerLoadResult: can't find patch file, is ok, just return I/Tinker.DefaultLoadReporter: patch loadReporter onLoadResult: patch load result, path:/data/user/0/com.upgrade.example.upgrade_demo/tinker, code: -2, cost: 3ms W/Tinker.Tinker: tinker load fail! I/Tinker.ComponentHotplug: method install() is not invoked, ignore ensuring operations. D/Tinker.DefaultAppLike: onCreate I/CrashReport: backup java handler: com.tencent.bugly.beta.tinker.TinkerUncaughtExceptionHandler@2a8d3e1 W/CrashReport: [patch] tinker new id is null ,so patch version is invalid I/CrashReport: TINKER_ID:base-1.0.7 I/CrashReport: NEW_TINKER_ID: W/Tinker.UpgradePatchRetry: onPatchRetryLoad retry info not exist, just return D/CrashReport: app version is: [1.0.7.8], [deviceId:null|null|f8ebe69f8bec5880], channel: [null], base tinkerId:[base-1.0.7], patch tinkerId:[], patch version:[] D/Tinker.TinkerManager: onDownloadSuccess. D/Tinker.TinkerManager: check if has new patch. D/Tinker.TinkerManager: has new patch. D/Tinker.TinkerManager: starting patch. I/Tinker.TinkerPatchListener: receive a patch file: /data/user/0/com.upgrade.example.upgrade_demo/app_tmpPatch/tmpPatch.apk, file size:105009 W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/com.upgrade.example.upgrade_demo/tinker/patch.info (No such file or directory) W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/com.upgrade.example.upgrade_demo/tinker/patch.info (No such file or directory) W/Tinker.UpgradePatchRetry: onPatchListenerCheck retry file is not exist, just return I/Tinker.TinkerPatchListener: get platform:null I/Tinker.TinkerPatchService: run patch service... D/Boost: hostingType=service, hostingName=com.upgrade.example.upgrade_demo/com.tencent.tinker.lib.service.TinkerPatchService, callerPackage=com.upgrade.example.upgrade_demo, isSystem=false, isBoostNeeded=false. I/ActivityManager: Start proc 758:com.upgrade.example.upgrade_demo:patch/u0a2031 for service com.upgrade.example.upgrade_demo/com.tencent.tinker.lib.service.TinkerPatchService caller=com.upgrade.example.upgrade_demo W/Tinker.TinkerLoader: tryLoadPatchFiles: we don't load patch with :patch process itself, just return D/Tinker.DefaultAppLike: onBaseContextAttached: I/Tinker.TinkerPatchListener: application maxMemory:256 W/Tinker.Tinker: tinker patch directory: /data/user/0/com.upgrade.example.upgrade_demo/tinker I/Tinker.Tinker: try to install tinker, isEnable: true, version: 1.9.13.2 I/Tinker.TinkerLoadResult: parseTinkerResult loadCode:-1, process name:com.upgrade.example.upgrade_demo:patch, main process:false, systemOTA:false, fingerPrint:Xiaomi/capricorn/capricorn:8.0.0/OPR1.170623.032/V10.2.2.0.OAGCNXM:user/release-keys, oatDir:null, useInterpretMode:false W/Tinker.TinkerLoadResult: tinker is disable, just return I/Tinker.DefaultLoadReporter: patch loadReporter onLoadResult: patch load result, path:/data/user/0/com.upgrade.example.upgrade_demo/tinker, code: -1, cost: 3ms W/Tinker.Tinker: tinker load fail! I/Tinker.ComponentHotplug: method install() is not invoked, ignore ensuring operations. D/Tinker.DefaultAppLike: onCreate I/CrashReport: backup java handler: com.tencent.bugly.beta.tinker.TinkerUncaughtExceptionHandler@f8b27eb I/Tinker.TinkerPatchService: for system version >= Android O, we just ignore increasingPriority job to avoid crash or toasts. I/Tinker.DefaultPatchReporter: patchReporter onPatchServiceStart: patch service start W/Tinker.UpgradePatchRetry: try copy file: /data/user/0/com.upgrade.example.upgrade_demo/app_tmpPatch/tmpPatch.apk to /data/user/0/com.upgrade.example.upgrade_demo/tinker_temp/temp.apk W/Tinker.UpgradePatchRetry: onPatchRetryLoad retry is not main process, just return I/Tinker.UpgradePatch: UpgradePatch tryPatch:patchMd5:a7bebf32dd6b1319935d801c848a44d6 W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/com.upgrade.example.upgrade_demo/tinker/patch.info (No such file or directory) W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/com.upgrade.example.upgrade_demo/tinker/patch.info (No such file or directory) I/Tinker.UpgradePatch: UpgradePatch tryPatch:patchVersionDirectory:/data/user/0/com.upgrade.example.upgrade_demo/tinker/patch-a7bebf32 W/Tinker.UpgradePatch: UpgradePatch copy patch file, src file: /data/user/0/com.upgrade.example.upgrade_demo/app_tmpPatch/tmpPatch.apk size: 105009, dest file: /data/user/0/com.upgrade.example.upgrade_demo/tinker/patch-a7bebf32/patch-a7bebf32.apk size:105009 W/Tinker.DexDiffPatchInternal: patch recover, dex is not contained W/Tinker.BsDiffPatchInternal: success recover bsdiff file: /data/user/0/com.upgrade.example.upgrade_demo/tinker/patch-a7bebf32/lib/lib/armeabi-v7a/libapp.so, use time: 899 I/Tinker.BsDiffPatchInternal: recover lib result:true, cost:908 W/Tinker.ResDiffPatchInternal: patch recover, resource is not contained I/Tinker.PatchInfo: rewritePatchInfoFile file path:/data/user/0/com.upgrade.example.upgrade_demo/tinker/patch.info , oldVer:, newVer:a7bebf32dd6b1319935d801c848a44d6, isProtectedApp:0, isRemoveNewVersion:0, fingerprint:Xiaomi/capricorn/capricorn:8.0.0/OPR1.170623.032/V10.2.2.0.OAGCNXM:user/release-keys, oatDir:odex I/Tinker.UpgradePatchRetry: onPatchResetMaxCheck, reset max check to 1 W/Tinker.UpgradePatch: UpgradePatch tryPatch: done, it is ok I/Tinker.DefaultPatchReporter: patchReporter onPatchResult: patch all result path: /data/user/0/com.upgrade.example.upgrade_demo/app_tmpPatch/tmpPatch.apk, success: true, cost: 1019 I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/com.upgrade.example.upgrade_demo/tinker_temp/temp.apk I/Tinker.TinkerResultService: TinkerResultService receive result: PatchResult: isSuccess:true rawPatchFilePath:/data/user/0/com.upgrade.example.upgrade_demo/app_tmpPatch/tmpPatch.apk costTime:1019 patchVersion:a7bebf32dd6b1319935d801c848a44d6 W/Tinker.DefaultTinkerResultService: deleteRawPatchFile rawFile path: /data/user/0/com.upgrade.example.upgrade_demo/app_tmpPatch/tmpPatch.apk I/CrashReport: Tinker patch success, result: PatchResult: isSuccess:true rawPatchFilePath:/data/user/0/com.upgrade.example.upgrade_demo/app_tmpPatch/tmpPatch.apk costTime:1019 patchVersion:a7bebf32dd6b1319935d801c848a44d6 I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/com.upgrade.example.upgrade_demo/app_tmpPatch/tmpPatch.apk I/Tinker.TinkerResultService: tinker wait screen to restart process
@githubjin did you succeed in flutter app @whybux how did you acheive that even patch is applied new resources not reflecting Reply in english please If you have a example repo please provide a link
Issue/提问须知
在提交issue之前,我们应该先查询是否已经有相关的issue以及常见问题。提交issue时,我们需要写明issue的原因,以及编译或运行过程的日志(加载进程以及Patch进程)。issue需要以下面的格式:
提问题时若使用
不能用/没效果/有问题/报错
此类模糊表达,但又没给出任何代码截图报错的,将绝对不会有任何反馈。这种issue也是一律直接关闭的,大家可以参阅提问的智慧。Tinker是一个开源项目,希望大家遇到问题时要学会先思考,看看sample与Tinker的源码,更鼓励大家给我们提pr.