【问题标题】:Flutter_downloader HardCrash on Android immediately after download start下载开始后立即在 Android 上出现 Flutter_downloader HardCrash
【发布时间】:2021-06-15 13:31:40
【问题描述】:

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

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

第二次崩溃: 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_examinations_on_17.03.2021.pdf,savedDir=/storage/emulated/0/Download,标头=,isResume=false D/DownloadWorker(28378):更新通知:{notificationId:1,标题:Notice_on_Postponement_of__scheduled_examinations_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.pdf的连接 I/com.mcd.twb(28378): 后台并发复制 GC 释放 23356(1592KB) AllocSpace objects, 90(3MB) LOS objects, 49% free, 5MB/10MB, paused 19.531ms 总共 75.666ms W/ContentCatcher(28378):无法通知 WebView E/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_examinations_on_17.03.2021.pdf,savedDir=/storage/emulated/0/Download,标头=,isResume=false D/DownloadWorker(32459):更新通知:{notificationId:1,标题:Notice_on_Postponement_of__scheduled_examinations_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.pdf的连接 I/com.mcd.twb(32459): NativeAlloc 并发复制 GC freed 22912(1545KB) AllocSpace objects, 82(2MB) LOS objects, 49% free, 5MB/10MB, paused 116us total 227.920ms I/flutter (32459):致命:找不到回调 与设备的连接断开。

【问题讨论】:

    标签: flutter flutter-android


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

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

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

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

      initFlutterDownloader();
      

      【讨论】:

        【解决方案3】:

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

        【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-07-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-08-24
        相关资源
        最近更新 更多