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

组下载崩溃 #368

Open
Reginer opened this Issue Mar 6, 2019 · 10 comments

Comments

Projects
None yet
2 participants
@Reginer
Copy link

Reginer commented Mar 6, 2019

Aria版本

3.6.1

什么问题

组下载直接就崩溃了

如何复现此问题

8.1系统,由于不知道组内几个文件的大小,随便给了个大小,为啥非要设置文件总大小呢?并不知道啊。

Aria.download(mContext).loadGroup(apkUrls).setFileSize(456164564).setDirPath(getDiskCacheFile(MdmConstant.NET_APP_FILE_DIR_NAME).absolutePath).start()

控制台日志

2019-03-06 10:25:39.055 1193-1342/win.regin.download W/System.err: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
2019-03-06 10:25:39.056 1193-1342/win.regin.download W/System.err:     at android.os.Handler.<init>(Handler.java:204)
2019-03-06 10:25:39.056 1193-1342/win.regin.download W/System.err:     at android.os.Handler.<init>(Handler.java:132)
2019-03-06 10:25:39.057 1193-1342/win.regin.download W/System.err:     at com.arialyy.aria.core.download.group.AbsGroupUtil.<init>(AbsGroupUtil.java:64)
2019-03-06 10:25:39.057 1193-1342/win.regin.download W/System.err:     at com.arialyy.aria.core.download.group.DownloadGroupUtil.<init>(DownloadGroupUtil.java:30)
2019-03-06 10:25:39.058 1193-1342/win.regin.download W/System.err:     at com.arialyy.aria.core.download.DownloadGroupTask.<init>(DownloadGroupTask.java:43)
2019-03-06 10:25:39.058 1193-1342/win.regin.download W/System.err:     at com.arialyy.aria.core.download.DownloadGroupTask.<init>(DownloadGroupTask.java:34)
2019-03-06 10:25:39.059 1193-1342/win.regin.download W/System.err:     at com.arialyy.aria.core.download.DownloadGroupTask$Builder.build(DownloadGroupTask.java:84)
2019-03-06 10:25:39.059 1193-1342/win.regin.download W/System.err:     at com.arialyy.aria.core.queue.TaskFactory.createDownloadGroupTask(TaskFactory.java:85)
2019-03-06 10:25:39.060 1193-1342/win.regin.download W/System.err:     at com.arialyy.aria.core.queue.TaskFactory.createTask(TaskFactory.java:70)
2019-03-06 10:25:39.060 1193-1342/win.regin.download W/System.err:     at com.arialyy.aria.core.queue.DownloadGroupTaskQueue.createTask(DownloadGroupTaskQueue.java:59)
2019-03-06 10:25:39.060 1193-1342/win.regin.download W/System.err:     at com.arialyy.aria.core.queue.DownloadGroupTaskQueue.createTask(DownloadGroupTaskQueue.java:28)
2019-03-06 10:25:39.061 1193-1342/win.regin.download W/System.err:     at com.arialyy.aria.core.command.normal.AbsNormalCmd.createTask(AbsNormalCmd.java:183)
2019-03-06 10:25:39.061 1193-1342/win.regin.download W/System.err:     at com.arialyy.aria.core.command.normal.StartCmd.executeCmd(StartCmd.java:67)
2019-03-06 10:25:39.062 1193-1342/win.regin.download W/System.err:     at com.arialyy.aria.core.AriaManager.exe(AriaManager.java:246)
2019-03-06 10:25:39.062 1193-1342/win.regin.download W/System.err:     at com.arialyy.aria.core.inf.AbsTarget.start(AbsTarget.java:221)
@AriaLyy

This comment has been minimized.

Copy link
Owner

AriaLyy commented Mar 6, 2019

3.6添加的限制,因为有些组的子任务实在太多了,如果是通过网络一个个请求文件大小,会看起来没响应,所以就增加了这个限制

@Reginer

This comment has been minimized.

Copy link
Author

Reginer commented Mar 6, 2019

有没有办法可以不设置它,因为并不能获取到总大小,只有网址。而且我不需要ui显示,只需要下载之后那个回调的路径,来安装apk就可以了。

@AriaLyy

This comment has been minimized.

Copy link
Owner

AriaLyy commented Mar 6, 2019

没有这个方法,除非你自行获取文件大小或者我后面弄个api获取文件大小,如果不需要UI显示的话,大小随便填个大于1的数,文件大小会影响到进度和百分比的显示

@Reginer

This comment has been minimized.

Copy link
Author

Reginer commented Mar 6, 2019

那就可以了。报错那个问题,我在我这的8.1手机都能复现,如果你打算修复需要协助取log的话,我可以给予帮助。

@AriaLyy

This comment has been minimized.

Copy link
Owner

AriaLyy commented Mar 6, 2019

崩溃问题和 #151 这个issue一样
new Handler使用Looper.getMainLooper() 就好了

@Reginer

This comment has been minimized.

Copy link
Author

Reginer commented Mar 6, 2019

可能是一样的。
我去下载那个目录下看,文件是没下载的。

@AriaLyy

This comment has been minimized.

Copy link
Owner

AriaLyy commented Mar 6, 2019

设置了文件大小,没有下载?

@Reginer

This comment has been minimized.

Copy link
Author

Reginer commented Mar 6, 2019

文件没下载的,只创建了文件夹。有时候还会报数据库错误,什么什么unique,再出现给你截log。

@AriaLyy

This comment has been minimized.

Copy link
Owner

AriaLyy commented Mar 6, 2019

我这是可以下载的,修改下组合任务的配置,3.6新增了子任务队列控制

@Reginer

This comment has been minimized.

Copy link
Author

Reginer commented Mar 6, 2019

能提供个demo的apk不,你这个项目太久了,在3.5的as上跑不了

AriaLyy added a commit that referenced this issue Mar 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.