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

下载完安装,一直报解析包错误 #745

Closed
JarvisGG opened this issue Aug 24, 2017 · 7 comments
Closed

下载完安装,一直报解析包错误 #745

JarvisGG opened this issue Aug 24, 2017 · 7 comments
Milestone

Comments

@JarvisGG
Copy link

Before Issue

  1. Please search on the Issues
  2. Please search on the wiki
  3. Please set FileDownloadLog.NEED_LOG=true and review the Logcat output from main process and :filedownloader process ( pay attention to Warn and Error level logcat)

Issue

  1. What problem do you get?
  2. Which version of FileDownloader are you using when you produce such problem?
  3. How to reproduce such problem?
  4. Do you set FileDownloadLog.NEED_LOG=true?
  5. Could you please reproduce this problem and provide all main process and :filedownloader process logcat on here:

P.S. If you don't know how to get :filedownloader process, it's recommended to using pidcat to just filter all your application logcat, or define process.non-separate=true on filedownloader.properties

@JarvisGG
Copy link
Author

很着急

@Jacksgong
Copy link
Collaborator

  1. FileDownloader本身有在下载完成的时候对需要下载的文件大小进行较验,如果文件大小与响应头给的大小不一致会抛error,因此如果下载完成文件大小肯定是对的。
  2. blockComplete中可以做一些md5校验之类的。

进一步

你可以把下载下来的文件,进行md5校验,或者是拷贝到电脑看看有什么问题。与服务端下发的有什么差别。

@JarvisGG
Copy link
Author

我是下载的apk,然后就下载完点击安装,就一直报解析包错误,然后我就打log看了一下,发现总是最后差一点点

@JarvisGG
Copy link
Author

方便的话,可以加下Q吗?真的很着急

@Jacksgong
Copy link
Collaborator

这边只要回调completed肯定是与后端给过来的文件大小是一致的,如果你发现本地文件在completed以后,还差一点点,咨询下后台同学,是否给过来的content-length本来就少了一点点?

@JarvisGG
Copy link
Author

你好,我这边发现了根本原因不是下载不全造成的,我打印了一下File.length,没问题。问题出在我是下载到data/data//files 这个路径下的,然后直接安装这个,就报解析包错误

@Jacksgong
Copy link
Collaborator

那你比对下电脑下载的与FileDownloader下载的文件的md5

@Jacksgong Jacksgong added this to the 1.6.6 milestone Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants