question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error receiving broadcast Intent android.intent.action.DOWNLOAD_COMPLETE

See original GitHub issue

Hi there! I’m using this plugin as update tool, and when I just about to finish downloading, as logs displayed at 99%, the app shutdown. My code was almost the same as the example, but not in main.dart, and using custom event to handle the event change.

static Future<void> tryOtaUpdate() async {
  try {
    if (Platform.isAndroid) {
      OtaUpdate().execute(Api.latestAndroid).listen((OtaEvent event) {
        Constants.eventBus.fire(new OTAEvent(event));
      });
    } else if (Platform.isIOS) {
      OtaUpdate().execute(Api.latestIOS).listen((OtaEvent event) {
        Constants.eventBus.fire(new OTAEvent(event));
      });
    }
  } catch (e) {
    print('Failed to make OTA update. Details: $e');
  }
}
class OTAEvent {
  OtaEvent otaEvent;
  OTAEvent(OtaEvent _otaEvent) {
    this.otaEvent = _otaEvent;
  }
}
eventBus.on<OTAEvent>().listen((event) {
  if (this.mounted) {
    setState(() {
      this.otaEvent = event.otaEvent;
    });
    print('OTA status: ${this.otaEvent.status} : ${this.otaEvent.value}');
  }
});
I/flutter (27797): OTA status: OtaStatus.DOWNLOADING : 99
E/AndroidRuntime(27797): FATAL EXCEPTION: main
E/AndroidRuntime(27797): Process: cn.xxx.xxx.xxxxxxx, PID: 27797
E/AndroidRuntime(27797): java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.DOWNLOAD_COMPLETE flg=0x10 pkg=cn.xxx.xxx.xxxxxxx (has extras) } in sk.fourq.otaupdate.OtaUpdatePlugin$1@50892f

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
MartinHlavnacommented, Nov 7, 2019

Documentation updated.

Thanks for the feedback.

0reactions
MartinHlavnacommented, Oct 20, 2021

@mHassan20896

Can you please provide full stack trace? Small project to reproduce the error would be also helpful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error receiving broadcast Intent on DownloadManager ...
Error receiving broadcast Intent on DownloadManager DOWNLOAD_COMPLETE Broadcast receiver ; java:751 ; 154) at android.app.ActivityThread.main ...
Read more >
Error receiving broadcast Intent act=android.intent.action ...
Here is my stack trace: java.lang.RuntimeException Error receiving broadcast Intent { act=android.intent.action.DOWNLOAD_COMPLETE flg=0x10 pkg=com.
Read more >
error receiving broadcast intent
The broadcast message itself is wrapped in an Intent object whose action string identifies the event that occurred (for example android.intent.action.
Read more >
java.lang.RuntimeException: Error receiving broadcast Intent ...
java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x4000010 (has extras) } in zl$a@5eda151 · Status ...
Read more >
Android BroadcastReceiver Example Tutorial | DigitalOcean
Broadcast receiver is generally implemented to delegate the tasks to services depending on the type of intent data that's received. Following ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found