Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

强制更新bug 用户可以在下载完成系统安装界面点击取消,回调不到dialogDismiss方法 #27

Closed
wentaibao opened this issue Aug 30, 2017 · 11 comments

Comments

@wentaibao
Copy link

版本1.5.3 系统MIUI9

操作步骤
1.进入应用发现更新,用户点击更新并下载完成
2.自动跳转到应用安装界面
3.此时用户点击系统安装界面的取消按钮,退出此次安装,能回调到onDownloadSuccess方法完成强制退出

4.用户再次打开应用,应用提示更新,点击更新,由于本地已经下载了安装包,不会重新下载,直接跳转安装界面
5.用户在此时再次点击取消安装,不能回调dialogDismiss或者onDownloadSuccess或者其他方法完成强制退出
此时用户就可以绕过强制更新而使用旧版本,复现率100%

暂时解决办法,setForceRedownload(true)开启强制重新下载

@AlexLiuSheng
Copy link
Owner

1.5.4已经解决,试试呢!在有缓存安装的时候也会回调onDownloadSuccess

@renmingjian
Copy link

我项目中用的Retrofit,用上你的库有冲突

@AlexLiuSheng
Copy link
Owner

冲突是什么

@renmingjian
Copy link

我添加上这行后运行项目就出错,我以为是与OKhttp冲突,就去掉了OKhttp的依赖,还是这个错误,
下面是报的错误
09-12 13:40:46.379 15523-15585/com.ccipa.wlw I/System.out: 数据请求的URLSet-Cookie: dSBmnAEGLKSESSID=m2e7igt0pcd5oi551m4j7dire1; expires=Tue, 12-Sep-2017 15:40:47 GMT; path=/; domain=zhinong.com
09-12 13:40:46.379 15523-15585/com.ccipa.wlw I/System.out: 数据请求的URLContent-Length: 150

                                                       --------- beginning of crash

09-12 13:40:46.383 15523-15585/com.ccipa.wlw E/AndroidRuntime: FATAL EXCEPTION: RxCachedThreadScheduler-1
Process: com.ccipa.wlw, PID: 15523
java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:62)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:154)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/http/HttpEngine;
at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:219)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
at okhttp3.RealCall.execute(RealCall.java:69)
at retrofit2.OkHttpCall.execute(OkHttpCall.java:177)
at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:111)
at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:92)
at rx.Observable$2.call(Observable.java:162)
at rx.Observable$2.call(Observable.java:154)
at rx.Observable$2.call(Observable.java:162)
at rx.Observable$2.call(Observable.java:154)
at rx.Observable.unsafeSubscribe(Observable.java:8098)
at rx.internal.operators.OperatorSubscribeOn$1$1.call(OperatorSubscribeOn.java:62)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423) 
at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:154) 
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
at java.lang.Thread.run(Thread.java:818) 
Caused by: java.lang.ClassNotFoundException: Didn't find class "okhttp3.internal.http.HttpEngine" on path: DexPathList[[zip file "/data/app/com.ccipa.wlw-2/base.apk"],nativeLibraryDirectories=[/data/app/com.ccipa.wlw-2/lib/arm64, /data/app/com.ccipa.wlw-2/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]

@renmingjian
Copy link

发现问题在哪里了:如果加日志拦截器,就报错,注释掉就没有问题了
HttpLoggingInterceptor logging = new HttpLoggingInterceptor(new HttpLoggingInterceptor.Logger() {
@OverRide
public void log(String message) {
System.out.println(REQUEST_URL + message);
}
});

                    logging.setLevel(HttpLoggingInterceptor.Level.BODY);
                    client = new OkHttpClient.Builder().addInterceptor(logging).build();

不知道咋回事

@renmingjian
Copy link

前面的问题没事了,还有一个问题:我传递了正确的APP下载地址,在网页上可以下载也可以安装到手机上。但是用你的这个库下载完成后去安装说是未安装。用debug版的下载安装不行,我就把APP正式打包了一个,然后下载安装还是出现应用未安装

@AlexLiuSheng
Copy link
Owner

未安装提示是签名问题?你看看下载目录下的apk是否是完整的 目录地址默认是:/storage/emulated/0/AllenVersionPath/

@renmingjian
Copy link

从这个目录下找到的apk是可以安装的。我把我手机上的APP卸载了再从这个目录找到下载的apk安装是可以安装的。但是我可以肯定的是我当前版本和之前版本是用一个keystore打包的,因为我电脑上都没有第二个签名文件?你说的签名问题是不是说我现在运行的签名和下载好的APP的签名不一致?

@AlexLiuSheng
Copy link
Owner

对啊 你确定下签名 还有就是下载app版本的versioncode是不是比当前运行版本低

@renmingjian
Copy link

好的,谢谢,我再看看吧

@qingchen1016
Copy link

我项目中用的Retrofit,用上你的库有冲突

请问你的这个问题解决了吗?我也是用的retrofit,感觉可能是和这个库的网络请求有冲突
也是只有注释掉日志拦截器才能用,请问除了注释日至拦截器还有别的办法吗? 开发中还是需要用到日志拦截器的
ps:我用的Retrofit + okhttp3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants