How to fix: android.app.RemoteServiceException: Bad notification posted from package *: Couldn't create icon: StatusBarIcon

What was happening was, I was including the integer reference to the icon in the PendingIntent bundle, and that integer was later being referenced while being posted to the NotificationManager.

In between getting the integer reference and the pending intent going off, the app was updated and all of the drawable references changed. The integer that used to reference the correct drawable now referenced either the incorrect drawable or none at all (none at all - causing this crash)


Using VectorXml inside your notification has been known to cause this issue. Use png's


Don't use SVG on Kitkat!

I had the same issue every time when I wanted to show a notification on Kitkat. What caused the problem for me is that I have defined every icon in xml (from svg), the small icon and the action icon also. After I have replaced them with png-s the problem solved at my side.