Android App crashes with local notifications when upgrading to Capacitor 3

The following crash is reported on my google play console, once upgrading to capacitor 3.

  at (
  at$1500 (
  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.ClassCastException: 
  at (
  at com.capacitorjs.plugins.localnotifications.NotificationStorage.getSavedNotificationAsJSObject (
  at com.capacitorjs.plugins.localnotifications.NotificationStorage.getSavedNotification (
  at com.capacitorjs.plugins.localnotifications.LocalNotificationRestoreReceiver.onReceive (
  at (

This is how I use the plugin:

PushNotifications.addListener('pushNotificationReceived', (notification: PushNotificationSchema) => {
            if(deviceService.getPlatform() === "android" ) {

    sendLocalNotification(notification: PushNotificationSchema){
        if(typeof(notification.title) !== 'undefined' 
            && typeof(notification.body) !== 'undefined'){
                    notifications: [{
                        title: notification.title ,
                        body: notification.body,
                        id: new Date().getUTCMilliseconds(),
                        schedule: {
                            at: new Date( + 1000)

Some important Notes:

  1. I use local notifications for displaying FCM push notifications on Android when the app is foreground.
    2.Downgrading to capacitor 2.2.0 prevents this crash.

1. What is causing this exception and how can I prevent it?

2. Is it a ‘real’ crash - meaning something the user is experiencing ? or is it an exception that is reported in the background?

I’ll appreciate any help as this is preventing me from releasing the app.

How are you importing PushNotifications?

import { PushNotifications } from ‘@capacitor/push-notifications’;

Could it be because the above methods are handled by a class that is created as a singleton?