havesource / cordova-plugin-push

Register and receive push notifications
MIT License
144 stars 276 forks source link

com.adobe.phonegap.push.FCMService.createNotification java.lang.IllegalArgumentException crashes #151

Open mifkys opened 2 years ago

mifkys commented 2 years ago

Bug Report

Several crash reports from Google Play:

1

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

Android 7, 7.1

(Android) Device Vendor (e.g. Samsung, HTC, Sony...)

Xiaomi Redmi 5 Plus Samsung Galaxy S6 Samsung Galaxy Note5 Xiaomi Redmi 4X

Logs taken while reproducing problem

java.lang.IllegalArgumentException: 
  at android.app.NotificationManager.notifyAsUser (NotificationManager.java:306)
  at android.app.NotificationManager.notify (NotificationManager.java:284)
  at com.adobe.phonegap.push.FCMService.createNotification (FCMService.kt:573)
  at com.adobe.phonegap.push.FCMService.showNotificationIfPossible (FCMService.kt:411)
  at com.adobe.phonegap.push.FCMService.onMessageReceived (FCMService.kt:136)
  at com.google.firebase.messaging.FirebaseMessagingService.zzd (Unknown Source)
  at com.google.firebase.iid.zzb.run (Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1133)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:607)
  at com.google.android.gms.common.util.concurrent.zza.run (Unknown Source)
  at java.lang.Thread.run (Thread.java:761)

2

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

Android 6

(Android) Device Vendor (e.g. Samsung, HTC, Sony...)

Kodak Ektra Samsung Galaxy A5 Sony Xperia Z3 LGE LG K8 ZTE BLADE A512

Logs taken while reproducing problem

java.lang.IllegalArgumentException: 
  at android.app.NotificationManager.notify (NotificationManager.java:222)
  at com.adobe.phonegap.push.FCMService.createNotification (FCMService.kt:573)
  at com.adobe.phonegap.push.FCMService.showNotificationIfPossible (FCMService.kt:411)
  at com.adobe.phonegap.push.FCMService.onMessageReceived (FCMService.kt:136)
  at com.google.firebase.messaging.FirebaseMessagingService.zzd (Unknown Source)
  at com.google.firebase.iid.zzb.run (Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1113)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:588)
  at com.google.android.gms.common.util.concurrent.zza.run (Unknown Source)
  at java.lang.Thread.run (Thread.java:818)

3

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

Android 10

(Android) Device Vendor (e.g. Samsung, HTC, Sony...)

Lenovo Yoga Smart Tab Redmi 9A

Logs taken while reproducing problem

java.lang.IllegalArgumentException: 
  at android.app.NotificationManager.fixNotification (NotificationManager.java:519)
  at android.app.NotificationManager.notifyAsUser (NotificationManager.java:498)
  at android.app.NotificationManager.notify (NotificationManager.java:447)
  at com.adobe.phonegap.push.FCMService.createNotification (FCMService.kt:573)
  at com.adobe.phonegap.push.FCMService.showNotificationIfPossible (FCMService.kt:411)
  at com.adobe.phonegap.push.FCMService.onMessageReceived (FCMService.kt:136)
  at com.google.firebase.messaging.FirebaseMessagingService.zzd (Unknown Source:67)
  at com.google.firebase.iid.zzf.run (Unknown Source:4)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at com.google.android.gms.common.util.concurrent.zza.run (Unknown Source:7)
  at java.lang.Thread.run (Thread.java:919)

cordova info Printout

Cordova Packages:

cli: 10.0.0
    common: 4.0.2
    create: 3.0.0
    lib: 10.1.0
        common: 4.0.2
        fetch: 3.0.1
        serve: 4.0.0

Project Installed Platforms:

android: 10.1.1

Project Installed Plugins:

@havesource/cordova-plugin-push: 3.0.0
branch-cordova-sdk: 4.2.0
cordova-clipboard: 1.3.0
cordova-plugin-androidx-adapter: 1.1.3
cordova-plugin-appodeal: 2.10.2
cordova-plugin-badge: 0.8.8
cordova-plugin-camera: 6.0.0
cordova-plugin-device: 2.0.2
cordova-plugin-facebook-connect: 3.0.0
cordova-plugin-file: 6.0.2
cordova-plugin-googleplus: 8.5.2
cordova-plugin-inappbrowser: 3.2.0
cordova-plugin-local-notification: 0.9.3
cordova-plugin-network-information: 2.0.2
cordova-plugin-purchase: 10.3.0
cordova-plugin-splashscreen: 5.0.4
cordova-plugin-statusbar: 2.4.2
cordova-plugin-vibration: 3.1.1
cordova-plugin-x-socialsharing: 5.6.0
cordova-sqlite-storage: 5.0.0
cordova-support-google-services: 1.3.2
es6-promise-plugin: 4.2.2
phonegap-plugin-multidex: 1.0.0
yandex-appmetrica-plugin-cordova: 3.20.1

Environment:

OS: Microsoft Windows 10 Pro 10.0.19043 (19043) (win32 10.0.19043) x64
Node: v10.19.0
npm: 6.14.4
ayan-dey commented 1 year ago

I have bypassed the cause of this by passing blank string for android notification icon while calling init for plugin.

this.push.init({
      android: {
        senderID: '345504629034',
        sound: 'true',
        forceShow: 'true',
        vibrate: 'true',
        icon: ''
      },
      ios: {
        alert: 'true',
        badge: 'true',
        sound: 'true',
        fcmSandbox: 'true'
      },
      windows: {}
});