TinkerPatch / tinkerpatch-sdk

TinkerPatch SDK
http://tinkerpatch.com
MIT License
294 stars 56 forks source link

I/Tinker.UrlConnectionFetcher: response code 404 msg: Not Found #58

Closed zhq93 closed 6 years ago

zhq93 commented 6 years ago

11-27 19:07:10.975 22512-22512/? W/Tinker.TinkerLoader: tryLoadPatchFiles:patch info not exist:/data/user/0/com.jdsq1/tinker/patch.info 11-27 19:07:10.977 22512-22512/? I/Tinker.ReflectApp: with app application from manifest applicationName:com.xxx.base.MyApplication 11-27 19:07:10.979 22512-22512/? I/Tinker.ReflectApp: replaceApplicationLike delegateClass:class com.tinkerpatch.sdk.loader.TinkerPatchApplicationLike 11-27 19:07:10.993 22512-22512/? I/Tinker.ComponentHotplug: method install() is not invoked, ignore ensuring operations. 11-27 19:07:10.999 22512-22512/? I/Tinker.ServerUtils: with app key from manifest appKey:xxxxxxxxx 11-27 19:07:11.000 22512-22512/? I/Tinker.ServerUtils: with app version from manifest appVersion:2.1.8 11-27 19:07:11.003 22512-22512/? I/Tinker.VersionInfo: readVersionInfo file path:/data/user/0/com.xxx/tinker_server/1b7c5d9b84b3a03b_version.info, appVersion: 2.1.8, uuid:c3b006e7-800f-4f4c-b6b7-99011d649d16, abi:armeabi-v7a, patchVersion:2, patchMd5:5a562b49ab6092b0579d45357696b16d, grayValue:10, crashTimes:0, retryTimes:2, applySuccess:0, patchSuccess:0 11-27 19:07:11.007 22512-22512/? I/Tinker.ServerClient: installTinkerServer, debug value: false, appVersion: 2.1.8, appKey: 1b7c5d9b84b3a03b 11-27 19:07:11.011 22512-22512/? W/Tinker.Tinker: tinker patch directory: /data/user/0/com.xxx/tinker 11-27 19:07:11.012 22512-22512/? I/Tinker.Tinker: try to install tinker, isEnable: true, version: 1.9.1 11-27 19:07:11.012 22512-22512/? I/Tinker.TinkerLoadResult: parseTinkerResult loadCode:-3, process name:com.xxx, main process:true, systemOTA:false, fingerPrint:Meizu/M1621/M1621:6.0/MRA58K/1479493959:user/release-keys, oatDir:null, useInterpretMode:false 11-27 19:07:11.013 22512-22512/? W/Tinker.TinkerLoadResult: can't find patch file, is ok, just return 11-27 19:07:11.013 22512-22512/? I/Tinker.DefaultLoadReporter: patch loadReporter onLoadResult: patch load result, path:/data/user/0/com.xxx/tinker, code: -3, cost: 3ms 11-27 19:07:11.013 22512-22512/? W/Tinker.Tinker: tinker load fail! 11-27 19:07:11.013 22512-22512/? I/Tinker.TinkerPatch: Init TinkerPatch sdk success, version:1.2.1 11-27 19:07:11.302 22512-22512/? I/Tinker.FetchPatchHandler: try to fetch patch update with FetchPatchHandler with interval 10800000 11-27 19:07:11.474 22512-22512/? W/Tinker.UpgradePatchRetry: onPatchRetryLoad patch file: /data/user/0/com.xxx/tinker_temp/temp.apk is not exist, just return 11-27 19:07:11.480 22512-22512/? W/Tinker.ClientImpl: [retryAllReportFails], there is no fail report, just return 11-27 19:07:11.481 22512-22512/? I/Tinker.ServerClient: tinker sync should wait interval 8873s 11-27 19:07:14.553 22512-22512/? I/Tinker.UrlConnectionFetcher: loadData from url: #http://q.tinkerpatch.com/c/1b7c5d9b84b3a03b?d=c3b006e7-800f-4f4c-b6b7-99011d649d16&v=1511780834549, method:GET, body:null 11-27 19:07:14.743 22512-22596/? I/Tinker.UrlConnectionFetcher: response code 404 msg: Not Found 你好,这是什么问题啊? 我看基准备与补丁包度已经正常打包好了 我将补丁包放入到了# http://www.tinkerpatch.com 官网我的App中 如下图(反正正式没一点用) 测试下 已经全量下发了,强制启动时去查询更新补丁,一点作用度没有?? 不知道什么原因......

正常来讲,下发全量包了 设置强制App启动更新补丁包,应该是去下载注入,锁屏重启生效删除补丁包的吧???

zhq93 commented 6 years ago

@simpleton 强制加载补丁的回调如下 TinkerPatch.with().fetchDynamicConfig(new ConfigRequestCallback() {

        @Override
        public void onSuccess(HashMap<String, String> configs) {
            TinkerLog.w("MainActivity", "-----success-----, config:" + configs.toString());
        }

        @Override
        public void onFail(Exception e) {
            TinkerLog.w("MainActivity", "-----failed-----, exception:" + e);
        }
    }, true);

日志 :-----failed-----, exception:java.io.FileNotFoundException: http://q.tinkerpatch.com/c/1b7c5d9b84b3a03b?d=c3b006e7-800f-4f4c-b6b7-99011d649d16&v=1511782725789

怎么回事呢 哪里的问题 很感谢!!!

simpleton commented 6 years ago

fetchDynamicConfig 并不是加载补丁,只是动态的KV配置。 接入例子: https://github.com/TinkerPatch/tinkerpatch-easy-sample 接入文档: http://tinkerpatch.com/Docs/SDK

On Mon, Nov 27, 2017 at 3:42 AM, SimpleGentleman notifications@github.com wrote:

@simpleton https://github.com/simpleton 强制加载补丁的回调如下 TinkerPatch.with().fetchDynamicConfig(new ConfigRequestCallback() {

    @Override
    public void onSuccess(HashMap<String, String> configs) {
        TinkerLog.w("MainFragment", "-----success-----, config:" + configs.toString());
    }

    @Override
    public void onFail(Exception e) {
        TinkerLog.w("MainFragment", "-----failed-----, exception:" + e);
    }
}, true);

日志 :-----failed-----, exception:java.io.FileNotFoundException: http://q.tinkerpatch.com/c/1b7c5d9b84b3a03b?d=c3b006e7- 800f-4f4c-b6b7-99011d649d16&v=1511782725789

怎么回事呢 哪里的问题 很感谢!!!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TinkerPatch/tinkerpatch-sdk/issues/58#issuecomment-347157871, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbvYm5ipewiO41yBklTHL_2lp2WMKpYks5s6qAXgaJpZM4Qrfwb .

zhq93 commented 6 years ago

@simpleton 你的意思是上面是即时访问配置环境的(比如,条件下发与灰度下发这些设置),然后 TinkerPatch.with().fetchPatchUpdate(true); 才是真正加载补丁的?

simpleton commented 6 years ago

是的

On Mon, Nov 27, 2017, 5:18 PM SimpleGentleman notifications@github.com wrote:

@simpleton https://github.com/simpleton 你的意思是上面是即时访问配置环境的(比如,条件下发与灰度下发这些设置),然后 TinkerPatch.with().fetchPatchUpdate(true); 才是真正加载补丁的?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/TinkerPatch/tinkerpatch-sdk/issues/58#issuecomment-347382133, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbvYooOhBuvMXHFENtOe5LSihqwYkoNks5s6193gaJpZM4Qrfwb .

zhq93 commented 6 years ago

@simpleton 非常感谢! 应该是这样

zhq93 commented 6 years ago

@simpleton 对了 这个不是没办法补丁包加载后即时生效嘛 ,好像这个sdk也没办法知道当前有没有加载补丁成功或者说回调来给我们自己设置杀死进程应用,自动重启生效,有些情况下用户是不知道的?有没有这方面的建议呢 ?

simpleton commented 6 years ago
.setPatchResultCallback(new ResultCallBack() {
    @Override public void onPatchResult(PatchResult patchResult) {
        Log.i(TAG, "onPatchResult callback here");
    }
})

http://tinkerpatch.com/Docs/api

zhq93 commented 6 years ago

@simpleton 我可能没有说的很明白 这个是可以 但是有个问题 就是每次去后台访问加载补丁包后 ,他都会自己杀死进程去重启,sdk没判断当前补丁是不是加载过; 现在的结果就是:只能等待用户自己重启或者说应用长时间没用被系统杀死才能生效,没办法做到加载成功自己启动立即生效同时,后续不会在去后台加载补丁(要的是这么个回调好像没有吧)?

zhq93 commented 6 years ago

@simpleton 对了 setPatchResultCallback这个方法不生效 我在主页面加载成功App杀死代码不生效 如下:TinkerPatch.with().setPatchResultCallback(new ResultCallBack() { //intentService线程中; @Override public void onPatchResult(PatchResult patchResult) { L.d("MainFragment", "------patchResult------" + patchResult.toString()); ShareTinkerInternals.killAllOtherProcess(getActivity().getApplicationContext()); android.os.Process.killProcess(android.os.Process.myPid()); } }); 连日志都没走,是回调有问题嘛?

simpleton commented 6 years ago

Sdk会判断的,只有当服务器patchversion大于本地才会更新并产生回调

On Mon, Nov 27, 2017, 7:03 PM SimpleGentleman notifications@github.com wrote:

@simpleton https://github.com/simpleton 对了 setPatchResultCallback这个方法不生效 我在主页面加载成功App杀死代码不生效 如下:TinkerPatch.with().setPatchResultCallback(new ResultCallBack() { //intentService线程中; @override https://github.com/override public void onPatchResult(PatchResult patchResult) { L.d("MainFragment", "------patchResult------" + patchResult.toString());

ShareTinkerInternals.killAllOtherProcess(getActivity().getApplicationContext()); android.os.Process.killProcess(android.os.Process.myPid()); } }); 连日志都没走,是回调有问题嘛?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/TinkerPatch/tinkerpatch-sdk/issues/58#issuecomment-347399200, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbvYj_beLicAwCOQJ2OgoRSFcQ_tCc7ks5s63f5gaJpZM4Qrfwb .

zhq93 commented 6 years ago

@simpleton 在application中初始化的时候就已经设置了这个: .setPatchRollbackOnScreenOff(true) //设置收到后台回退要求时,锁屏清除补丁,默认是等主进程重启时自动清除 .setPatchRestartOnSrceenOff(true) //设置补丁合成成功后,锁屏重启程序,默认是等应用自然重启

1.合成成功后本地补丁应该被清楚掉了吧,sdk怎么比较服务器与本地的补丁版本号呢?理解有问题嘛? 2.上面的合成补丁setPatchResultCallback结果回调怎么不响应,估计什么原因导致的,是不是只能用户手动启动才能生效啊?

simpleton commented 6 years ago

@SimpleGentleman

  1. 会别配置文件来记录已合成的appVersion
  2. callback只会在合成成功才会有
zhq93 commented 6 years ago

@simpleton 好的 谢谢!

zhq93 commented 6 years ago

@simpleton 刚才试了8台手机 发现19一下 也就是4.4下的不行 不会向平台下载补丁包,感觉是不是不支持4.4左右的?;其次三星的android7.1的三星也不行 不仅仅sdk21 5.0系统的; 非常谢谢!

simpleton commented 6 years ago

支持的,你可以先使用sample跑通。然后再集成到你的项目中

On Mon, Nov 27, 2017, 10:52 PM SimpleGentleman notifications@github.com wrote:

@simpleton https://github.com/simpleton 刚才试了8台手机 发现19一下 也就是4.4下的不行 不会向平台下载补丁包,感觉是不是不支持4.4左右的?;其次三星的android7.1的三星也不行 不仅仅sdk21 5.0系统的; 非常谢谢!

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/TinkerPatch/tinkerpatch-sdk/issues/58#issuecomment-347430651, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbvYjUXnRPNvXJeY8q3b9mIdiiXaOb9ks5s662ggaJpZM4Qrfwb .

zhq93 commented 6 years ago

@simpleton 恩恩 谢谢