flutter_local_notifications
flutter_local_notifications copied to clipboard
Invalid notification (no valid small icon)
Although we tried all the methods we found here and on the internet, we could not solve the problem. There was a problem with the plugin.

Future<void> initializeLocalNotification() async {
tz.initializeTimeZones();
tz.setLocalLocation(tz.getLocation('America/Detroit'));
const AndroidInitializationSettings initializationSettingsAndroid =
AndroidInitializationSettings('ic_stat_rcicon');
const InitializationSettings initializationSettings = InitializationSettings(
android: initializationSettingsAndroid,
);
await _flutterLocalNotificationsPlugin.initialize(
initializationSettings,
onSelectNotification: (_) {},
);
}
Sample code to reproduce the problem
Fatal Exception: java.lang.RuntimeException
Unable to start receiver com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver: java.lang.IllegalArgumentException: Invalid notification (no valid small icon): Notification(channel=123 shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0x10 color=0x00000000 vis=PRIVATE internalType=0 internalPriority=0 internalGroupPriority=0 internalFlag=0)
Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver: java.lang.IllegalArgumentException: Invalid notification (no valid small icon): Notification(channel=123 shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0x10 color=0x00000000 vis=PRIVATE internalType=0 internalPriority=0 internalGroupPriority=0 internalFlag=0)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:4637)
at android.app.ActivityThread.access$1900(ActivityThread.java:284)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2295)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:334)
at android.app.ActivityThread.main(ActivityThread.java:8396)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1068)
Caused by java.lang.IllegalArgumentException
Invalid notification (no valid small icon): Notification(channel=123 shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0x10 color=0x00000000 vis=PRIVATE internalType=0 internalPriority=0 internalGroupPriority=0 internalFlag=0)
Caused by java.lang.IllegalArgumentException: Invalid notification (no valid small icon): Notification(channel=123 shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0x10 color=0x00000000 vis=PRIVATE internalType=0 internalPriority=0 internalGroupPriority=0 internalFlag=0)
at android.app.NotificationManager.fixNotification(NotificationManager.java:724)
at android.app.NotificationManager.notifyAsUser(NotificationManager.java:703)
at android.app.NotificationManager.notify(NotificationManager.java:652)
at androidx.core.app.NotificationManagerCompat.notify(NotificationManagerCompat.java:223)
at androidx.core.app.NotificationManagerCompat.notify(NotificationManagerCompat.java:205)
at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.showNotification(FlutterLocalNotificationsPlugin.java:1042)
at com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver.onReceive(ScheduledNotificationReceiver.java:41)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:4628)
at android.app.ActivityThread.access$1900(ActivityThread.java:284)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2295)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:334)
at android.app.ActivityThread.main(ActivityThread.java:8396)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1068)
If you believe the issue with the plugin then please provide a link to a repository hosting a minimal app that can reproduce the issue. One question I do have though is do you experience the issue with the debug builds?
Closing due to lack of response to provide the information that has been requested. If you can do so then feel free to re-open the issue
@hsnbsst I'm having the same problem. Did you solve this?