carp-dk / carp-dk/flutter-plugins

notifications: ^2.0.1 - Android APP Keep Stopping in Samsung Device

Open
#614 0 comments 0 reactions 0 assignees View on GitHub
bugfix
Dominant language
Dart
Stars
608
Forks
735
Avg merge
1m
Merged PRs (30d)
3

Description

### notifications: ^2.0.1

### Device / Emulator and OS
- Device: [e.g. Samsung ]
- OS: [e.g. Android 12]

### Describe the bug
notifications: ^2.0.1 used to fetch Notifications but when app app background sometimes app keep stopping particularly in dial pad app is crashed.

```
Shutting down VM
E/AndroidRuntime( 9928): FATAL EXCEPTION: main
E/AndroidRuntime( 9928): Process: com.example.testapp, PID: 9928
E/AndroidRuntime( 9928): java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String java.lang.CharSequence.toString()' on a null object reference
E/AndroidRuntime( 9928): at dk.cachet.notifications.NotificationListener.onNotificationPosted(NotificationListener.java:41)
E/AndroidRuntime( 9928): at android.service.notification.NotificationListenerService.onNotificationPosted(NotificationListenerService.java:444)
E/AndroidRuntime( 9928): at android.service.notification.NotificationListenerService$MyHandler.handleMessage(NotificationListenerService.java:2337)
E/AndroidRuntime( 9928): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime( 9928): at android.os.Looper.loopOnce(Looper.java:226)
E/AndroidRuntime( 9928): at android.os.Looper.loop(Looper.java:313)
E/AndroidRuntime( 9928): at android.app.ActivityThread.main(ActivityThread.java:8751)
E/AndroidRuntime( 9928): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 9928): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
E/AndroidRuntime( 9928): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
I/Process ( 9928): Sending signal. PID: 9928 SIG: 9
```

### Screenshot
![Screenshot_20221028-103904_Phone](https://user-images.githubusercontent.com/115148874/198508927-de06b442-c253-40d8-bd2f-62cf8798bfa8.jpg)
ts

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at NotificationListener.java:41, where the stack trace reports the NullPointerException, and review how Android notifications are handled through NotificationListenerService. Reproduce the crash when the app is in the background, particularly around the dial pad scenario. Done means the app remains running when the reported notification event occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, dart, flutter
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.