簡體   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