繁体   English   中英

下载开始后立即在 Android 上出现 Flutter_downloader HardCrash

[英]Flutter_downloader HardCrash on Android immediately after download start

谁能解释我出了什么问题。 我尝试了两天但无法解决,应用程序一次又一次地崩溃。 下载正常,但添加新页面后,只是为了添加新下载,应用程序崩溃了,即使删除页面后也继续崩溃。

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

第二次崩溃: D/EgretLoader(28378):EgretLoader(Context context) 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_examinations_on_17.03.2021.pdf,savedDir=/storage/emulated/0/Download,header=,isResume=false D /DownloadWorker(28378): Update notification: {notificationId: 1, title: Notice_on_Postponement_of__scheduled_examinations_on_17.03.2021.pdf, status: 2, progress: 0} D/DownloadWorker(28378): Open connection to https://bppimt.ac.in/ nu/Notice/Notice_on_Postponement_of__scheduled_examinations_on_17.03.2021.pdf I/com.mcd.twb(28378):后台并发复制GC释放23356(1592KB ) AllocSpace objects, 90(3MB) LOS objects, 49% free, 5MB/10MB, paused 19.531ms total 75.666ms W/ContentCatcher(28378): Failed to notify a WebView E/libEGL (28378): call to OpenGL ES API with没有当前上下文(每个线程记录一次) 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 与设备的连接丢失。

Rest of the crashes: 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_examinations_on_17.03.2021.pdf,savedDir=/storage/emulated /0/Download,header=,isResume=false D/DownloadWorker(32459):更新通知:{notificationId:1,标题:Notice_on_Postponement_of__scheduled_examinations_on_17.03.2021.pdf,状态:2,进度:0} D/Download(): connection to https://bppimt.ac.in/nu/Notice/Notice_on_Postponement_of__scheduled_examinations_on_17.03.2021.pdf I/com.mcd.twb(32459): NativeAlloc concurrent copying GC freed 22912(1545KB) AllocSpace objects, 82(2MB) LOS objects , 49% free, 5MB/10MB, paused 116us total 227.920ms I/flutter (32459): Fatal: 找不到回调丢失与设备的连接。

回答我自己的问题。 问题终于解决了,是我的代码的问题。 实际上我已经在主频道之外创建了新页面。 所以它没有正确初始化。 现在它工作正常。

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

那么请确保您已经注册了下载回调,检查它#445

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

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

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

initFlutterDownloader();

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM