xuexiangjys / XUpdate

🚀A lightweight, high availability Android version update framework.(一个轻量级、高可用性的Android版本更新框架)
https://github.com/xuexiangjys/XUpdate/wiki
Apache License 2.0
2.33k stars 406 forks source link

返回数据都是对的,但是提示如下,也不下载新版本,报错入下 #133

Closed johncn9 closed 3 years ago

johncn9 commented 3 years ago

I/System.out: 下载地址:::::::::/storage/emulated/0/Download D/[XUpdate]: XUpdate.update()启动:XUpdate{mUpdateUrl='http://192.168.43.16:1111/update/checkVersion2', mParams={appKey=ab55ce55Ac4bcP408cPb8c1Aaeac179c5f6f, versionCode=3, versionName=0.2.5}, mApkCacheDir='/storage/emulated/0/Download', mIsWifiOnly=false, mIsGet=false, mIsAutoMode=false} I/TetheringManager: registerTetheringEventCallback:com.warunion D/[XUpdate]: 开始检查版本信息... I/System.out: reponse:::::{"code":0,"msg":"","data":{"versionId":15,"updateStatus":1,"versionCode":5,"versionName":"1.2.5","uploadTime":"2021-06-26 00:19:30","apkSize":13777,"appKey":"ab55ce55Ac4bcP408cPb8c1Aaeac179c5f6f","modifyContent":"1、优化api接口。\r\n2、添加使用demo演示。\r\n3、新增自定义更新服务API接口。\r\n4、优化更新提示界面。","downloadUrl":"http://res.warunion.com:18019/apk/modile-debug.apk","apkMd5":"BF289EF43788E5DF553F5428DCF30BCC"}} I/[XUpdate]: 服务端返回的最新版本信息:{"code":0,"msg":"","data":{"versionId":15,"updateStatus":1,"versionCode":5,"versionName":"1.2.5","uploadTime":"2021-06-26 00:19:30","apkSize":13777,"appKey":"ab55ce55Ac4bcP408cPb8c1Aaeac179c5f6f","modifyContent":"1、优化api接口。\r\n2、添加使用demo演示。\r\n3、新增自定义更新服务API接口。\r\n4、优化更新提示界面。","downloadUrl":"http://res.warunion.com:18019/apk/modile-debug.apk","apkMd5":"BF289EF43788E5DF553F5428DCF30BCC"}} I/[XUpdate]: 未发现新版本! W/System.err: It's the latest version! W/System.err: at com.xuexiang.xupdate._XUpdate.onUpdateError(_XUpdate.java:212) at com.xuexiang.xupdate.proxy.impl.DefaultUpdateChecker.noNewVersion(DefaultUpdateChecker.java:147) at com.xuexiang.xupdate.UpdateManager.noNewVersion(UpdateManager.java:361) at com.xuexiang.xupdate.utils.UpdateUtils.processUpdateEntity(UpdateUtils.java:94) at com.xuexiang.xupdate.proxy.impl.DefaultUpdateChecker.processCheckResult(DefaultUpdateChecker.java:137) at com.xuexiang.xupdate.proxy.impl.DefaultUpdateChecker.onCheckSuccess(DefaultUpdateChecker.java:102) at com.xuexiang.xupdate.proxy.impl.DefaultUpdateChecker.access$000(DefaultUpdateChecker.java:46) at com.xuexiang.xupdate.proxy.impl.DefaultUpdateChecker$2.onSuccess(DefaultUpdateChecker.java:77) at com.warunion.http.OKHttpUpdateHttpService$2.onResponse(OKHttpUpdateHttpService.java:84) at com.warunion.http.OKHttpUpdateHttpService$2.onResponse(OKHttpUpdateHttpService.java:75) W/System.err: at com.zhy.http.okhttp.OkHttpUtils$3.run(OkHttpUtils.java:186) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7656) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

johncn9 commented 3 years ago

数据库的版本比本地的要大 versionCode versionName都是大于本地开发环境的 服务器给到客户端的数据也是对的

xuexiangjys commented 3 years ago

I/System.out: 下载地址:::::::::/storage/emulated/0/Download D/[XUpdate]: XUpdate.update()启动:XUpdate{mUpdateUrl='http://192.168.43.16:1111/update/checkVersion2', mParams={appKey=ab55ce55Ac4bcP408cPb8c1Aaeac179c5f6f, versionCode=3, versionName=0.2.5}, mApkCacheDir='/storage/emulated/0/Download', mIsWifiOnly=false, mIsGet=false, mIsAutoMode=false} I/TetheringManager: registerTetheringEventCallback:com.warunion D/[XUpdate]: 开始检查版本信息... I/System.out: reponse:::::{"code":0,"msg":"","data":{"versionId":15,"updateStatus":1,"versionCode":5,"versionName":"1.2.5","uploadTime":"2021-06-26 00:19:30","apkSize":13777,"appKey":"ab55ce55Ac4bcP408cPb8c1Aaeac179c5f6f","modifyContent":"1、优化api接口。\r\n2、添加使用demo演示。\r\n3、新增自定义更新服务API接口。\r\n4、优化更新提示界面。","downloadUrl":"http://res.warunion.com:18019/apk/modile-debug.apk","apkMd5":"BF289EF43788E5DF553F5428DCF30BCC"}} I/[XUpdate]: 服务端返回的最新版本信息:{"code":0,"msg":"","data":{"versionId":15,"updateStatus":1,"versionCode":5,"versionName":"1.2.5","uploadTime":"2021-06-26 00:19:30","apkSize":13777,"appKey":"ab55ce55Ac4bcP408cPb8c1Aaeac179c5f6f","modifyContent":"1、优化api接口。\r\n2、添加使用demo演示。\r\n3、新增自定义更新服务API接口。\r\n4、优化更新提示界面。","downloadUrl":"http://res.warunion.com:18019/apk/modile-debug.apk","apkMd5":"BF289EF43788E5DF553F5428DCF30BCC"}} I/[XUpdate]: 未发现新版本! W/System.err: It's the latest version! W/System.err: at com.xuexiang.xupdate._XUpdate.onUpdateError(_XUpdate.java:212) at com.xuexiang.xupdate.proxy.impl.DefaultUpdateChecker.noNewVersion(DefaultUpdateChecker.java:147) at com.xuexiang.xupdate.UpdateManager.noNewVersion(UpdateManager.java:361) at com.xuexiang.xupdate.utils.UpdateUtils.processUpdateEntity(UpdateUtils.java:94) at com.xuexiang.xupdate.proxy.impl.DefaultUpdateChecker.processCheckResult(DefaultUpdateChecker.java:137) at com.xuexiang.xupdate.proxy.impl.DefaultUpdateChecker.onCheckSuccess(DefaultUpdateChecker.java:102) at com.xuexiang.xupdate.proxy.impl.DefaultUpdateChecker.access$000(DefaultUpdateChecker.java:46) at com.xuexiang.xupdate.proxy.impl.DefaultUpdateChecker$2.onSuccess(DefaultUpdateChecker.java:77) at com.warunion.http.OKHttpUpdateHttpService$2.onResponse(OKHttpUpdateHttpService.java:84) at com.warunion.http.OKHttpUpdateHttpService$2.onResponse(OKHttpUpdateHttpService.java:75) W/System.err: at com.zhy.http.okhttp.OkHttpUtils$3.run(OkHttpUtils.java:186) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7656) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

麻烦非默认json格式的请自定义解析器: https://github.com/xuexiangjys/XUpdate/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98#2%E9%97%AE%E6%88%91%E4%B8%8D%E6%83%B3%E4%BD%BF%E7%94%A8%E6%A1%86%E6%9E%B6%E9%BB%98%E8%AE%A4%E7%9A%84%E8%AF%B7%E6%B1%82%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%94%E5%9B%9E%E7%9A%84json%E6%A0%BC%E5%BC%8F%E5%9B%A0%E4%B8%BA%E5%85%AC%E5%8F%B8%E7%9A%84%E5%90%8E%E7%AB%AF%E6%9C%89%E8%87%AA%E5%B7%B1%E7%9A%84%E4%B8%80%E5%A5%97%E6%95%B0%E6%8D%AE%E8%BF%94%E5%9B%9E%E6%A0%BC%E5%BC%8F%E6%88%91%E8%AF%A5%E6%80%8E%E4%B9%88%E5%8A%9E