MaikuB / MaikuB/flutter_local_notifications

java.lang.RuntimeException: Unable to start service com.dexterous.flutterlocalnotifications.ForegroundService@1985771 with Intent { cmp=com.xxx.xxx/com.dexterous.flutterlocalnotifications.ForegroundService (has extras) }: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference

Open
#2,242 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
2.7k
Forks
1.6k
Avg merge
4d 8h
Merged PRs (30d)
4

Description

E/AndroidRuntime(11842): java.lang.RuntimeException: Unable to start service com.dexterous.flutterlocalnotifications.ForegroundService@1985771 with Intent { cmp=com.zhanghongyang.todo/com.dexterous.flutterlocalnotifications.ForegroundService (has extras) }: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
E/AndroidRuntime(11842): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5408)
E/AndroidRuntime(11842): at android.app.ActivityThread.access$3200(ActivityThread.java:283)
E/AndroidRuntime(11842): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2584)
E/AndroidRuntime(11842): at android.os.Handler.dispatchMessage(Handler.java:109)
E/AndroidRuntime(11842): at android.os.Looper.loopOnce(Looper.java:206)
E/AndroidRuntime(11842): at android.os.Looper.loop(Looper.java:296)
E/AndroidRuntime(11842): at android.app.ActivityThread.main(ActivityThread.java:9047)
E/AndroidRuntime(11842): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(11842): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
E/AndroidRuntime(11842): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:968)
E/AndroidRuntime(11842): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
E/AndroidRuntime(11842): at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.setSmallIcon(FlutterLocalNotificationsPlugin.java:463)
E/AndroidRuntime(11842): at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.createNotification(FlutterLocalNotificationsPlugin.java:364)
E/AndroidRuntime(11842): at com.dexterous.flutterlocalnotifications.ForegroundService.onStartCommand(ForegroundService.java:29)
E/AndroidRuntime(11842): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5388)
E/AndroidRuntime(11842): ... 9 more
I/ClientTransactionHandler(11842): send EXECUTE_TRANSACTION
I/ClientTransactionHandler(11842): send EXECUTE_TRANSACTION
I/Process (11842): Sending signal. PID: 11842 SIG: 9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the stack trace in FlutterLocalNotificationsPlugin.java at setSmallIcon (line 463), then inspect createNotification (line 364) and ForegroundService.java (line 29). Reproduce the foreground-service startup failure and determine why a null Integer reaches setSmallIcon; done means the service starts without this NullPointerException and creates its notification.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, dart, flutter, java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.