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.

Hundreds of crash reports from Google Play Console after deploying 0.9.0-beta3

See original GitHub issue


Provide a general summary of the issue.

Your Environment

  • Plugin version: 0.9.0-beta3
  • Platform: Android
  • OS version: 8.1 / 8.0
  • Device manufacturer / model: Mostly Pixels
  • Cordova version (cordova -v): 8.0.0
  • Cordova platform version (cordova platform ls): cordova-android 6.4.0
  • Plugin config
  • Ionic Version (if using Ionic) 3.9.2, using the plugin without ionic-native layer

Expected Behavior

Actual Behavior

After deploying an update to the play store a few days ago, I have been getting hundreds of crash reports from Google for devices running Android 8.1. and 8.0 (error attached below). No user complained yet, so I don’t know if the problem has any actual impact. I have tested the app on a Nexus 5X running android 8.1 as well as a few emulators, and I haven’t noticed any issues.

I am reporting this here just so you are aware, in case there is some actual issue.

Steps to Reproduce


Debug logs

This is the error google has been reporting

  at (
  at (Unknown Source)
  at$H.handleMessage (
  at android.os.Handler.dispatchMessage (
  at android.os.Looper.loop (
  at (
  at java.lang.reflect.Method.invoke (Native Method)
  at$ (
  at (

Caused by: java.lang.IllegalStateException: 
  at (
  at (
  at android.content.ContextWrapper.getSharedPreferences (
  at android.content.ContextWrapper.getSharedPreferences (
  at de.appplant.cordova.plugin.notification.Manager.getPrefs (
  at de.appplant.cordova.plugin.notification.Manager.getIds (
  at de.appplant.cordova.plugin.notification.Manager.getOptions (
  at de.appplant.cordova.plugin.notification.receiver.AbstractRestoreReceiver.onReceive (
  at (

Source code

This is a simplified version of the code I use to set notifications:

  setNotification(every:string, firstAt:Date){

    let text = this.notificationStrings.daily;

    let n:number = 30; // arbitrary large number
    let notifications = [];

    for (let i:number=0; i<n; i++){
      let theAt: Date = new Date(firstAt);
      if (every == 'minute'){
      }else if (every == 'hour'){
      }else if (every == 'day'){
      }else if (every == 'week'){
          id: i,
          title: this.notificationStrings.title,
          text: text,
          icon: "",
          sound: true,
          priority: 1,
          smallIcon: "res://"+this.notificationStrings.icon,
          foreground: true,
          wakeup: false,
            at: theAt


      () => {
          () => {
            console.log("notification set ", firstAt, every);

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:33 (3 by maintainers)

github_iconTop GitHub Comments

Reactor13commented, Apr 17, 2018

To fix this crash.

  1. Open file: …/platforms/android/src/de/appplant/cordova/plugin/notification/receiver/

  2. Add import: import android.os.UserManager;

  3. Change strings 60-61 if (action.equals(ACTION_BOOT_COMPLETED) && SDK_INT >= 24) return;


if (SDK_INT >= 24) { UserManager um = (UserManager) context.getSystemService(UserManager.class); if (um == null || um.isUserUnlocked() == false) return; }

jpierrontcommented, May 4, 2018

Great, notifications are triggered even after device reboot ! (Tested on Android 4.4, 5.1, 6.0, 7.1, 8.1). Thx @Reactor13 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

View crashes and application not responding (ANR) errors
Using Play Console, you can view data for crashes and application not responding (ANR) errors for your apps. Data comes from Android devices...
Read more >
Burst of app crashes immediately after publishing to Google Play
Since soon after publishing a new version I see crashes almost only from this device, I'm guessing it's a Google Play new app...
Read more >
A brand new website interface for an even better experience!
Hundreds of crash reports from Google Play Console after deploying 0.9.0-beta3.
Read more >
Internal testing | Google Play Console
Quickly distribute your builds to a small set of trusted testers without the need to wait for app reviews. Integrate with build qualification...
Read more >
Detect and diagnose crashes - Android Developers
An Android app crashes whenever there's an unexpected exit caused by ... how Google Play collects Android vitals data, see the Play Console...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found