下载开始后立即在安卓系统上运行Flutter_downloader HardCrash



有人能解释一下出了什么问题吗。我尝试了两天,但无法解决,应用程序一次又一次崩溃。下载工作正常,但在添加新页面后,为了添加新的下载,应用程序崩溃了,甚至在删除页面后,它也继续崩溃。

第一次崩溃:没有信息,突然断开连接。

第二次崩溃:D/EgretLoader(28378(:EgretLoader[上下文上下文]D/EgretLoader(28378(:上下文不是活动W/WM WorkSpec(28378(:退避延迟持续时间小于最小值D/DownloadWorker(28378(:DownloadWorker{url=https://bppimt.ac.in/nu/Notice/Notice_on_Postponement_of__scheduled_examinations_on_17.03.2021.pdf,filename=Notice_on_Postponement_of_scheduled_elections_on_17.03.2021.pdf,savedDir=/storage/simulated/0/Download,header=,isResume=falseD/DownloadWorker(28378(:更新通知:{notificationId:1,title:Notice_on_Postponement_of_scheduled_elections_on_17.03.2021.pdf,状态:2,进度:0}D/DownloadWorker(28378(:打开到的连接https://bppimt.ac.in/nu/Notice/Notice_on_Postponement_of__scheduled_examinations_on_17.03.2021.pdfI/com.mcd.twb(28378(:后台并发复制GC释放23356(1592KB(AllocSpace对象,90(3MB(LOS对象,49%可用,5MB/10MB,暂停19.531ms总计75.666msW/ContentCatcher(28378(:无法通知WebViewE/libEGL(28378(:在没有当前上下文的情况下调用OpenGL ES API(每个线程记录一次(I/flutter(28378(:致命:找不到回调E/libEGL(28378(:validate_display:92错误3008(EGL_BAD_display(I/chatty(28378(:uid=10621(com.mcd.twb(RenderThread相同的3行E/libEGL(28378(:validate_display:92错误3008(EGL_BAD_display(F/OpenGLRenderer(28378(:无法在曲面0x79eadeef00上设置损坏区域,错误=EGL_BAD_DISPLAY与设备的连接丢失。

其余崩溃:D/DownloadWorker(32459(:DownloadWorker{url=https://bppimt.ac.in/nu/Notice/Notice_on_Postponement_of__scheduled_examinations_on_17.03.2021.pdf,filename=Notice_on_Postponement_of_scheduled_elections_on_17.03.2021.pdf,savedDir=/storage/simulated/0/Download,header=,isResume=falseD/DownloadWorker(32459(:更新通知:{notificationId:1,title:Notice_on_Postponement_of_scheduled_elections_on_17.03.2021.pdf,状态:2,进度:0}D/DownloadWorker(32459(:打开到的连接https://bppimt.ac.in/nu/Notice/Notice_on_Postponement_of__scheduled_examinations_on_17.03.2021.pdfI/com.mcd.twb(32459(:NativeAlloc并发复制GC释放了22912个(1545KB(AllocSpace对象,82个(2MB(LOS对象,49%可用,5MB/10MB,总共暂停了116us 227.920msI/flutter(32459(:致命:找不到回调与设备的连接丢失。

回答我自己的问题。问题终于解决了,这就是我的代码问题。事实上,我已经在主频道之外创建了新页面。因此它没有正确初始化。现在运行良好。

如果有人面临同样的问题,应用程序在开始下载后会立即崩溃。

然后请确保您已注册下载回调,检查#445

对于遇到此问题的任何人,请执行以下操作:

initFlutterDownloader() async {
await FlutterDownloader.initialize(
debug: true // optional: set false to disable printing logs to 
console
);
}

然后将此代码粘贴到initState中要下载文件的页面中:

initFlutterDownloader();

最新更新