title: Flutter local notifications throwing an error
body: <p>While trying to show the notifications from <code>flutter_local_notification</code> it throws the following error:</p>
  <pre><code>E/MethodChannel#dexterous.com/flutter/local_notifications(10962): Failed to handle method call
  E/MethodChannel#dexterous.com/flutter/local_notifications(10962): java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
  E/MethodChannel#dexterous.com/flutter/local_notifications(10962):   at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.setSmallIcon(FlutterLocalNotificationsPlugin.java:188)
  E/MethodChannel#dexterous.com/flutter/local_notifications(10962):   at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.createNotification(FlutterLocalNotificationsPlugin.java:146)
  E/MethodChannel#dexterous.com/flutter/local_notifications(10962):   at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.showNotification(FlutterLocalNotificationsPlugin.java:688)
  E/MethodChannel#dexterous.com/flutter/local_notifications(10962):   at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.show(FlutterLocalNotificationsPlugin.java:827)
  E/MethodChannel#dexterous.com/flutter/local_notifications(10962):   at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.onMethodCall(FlutterLocalNotificationsPlugin.java:750)
  E/MethodChannel#dexterous.com/flutter/local_notifications(10962):   at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226)
  E/MethodChannel#dexterous.com/flutter/local_notifications(10962):   at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
  E/MethodChannel#dexterous.com/flutter/local_notifications(10962):   at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631)
  E/MethodChannel#dexterous.com/flutter/local_notifications(10962):   at android.os.MessageQueue.nativePollOnce(Native Method)
  E/MethodChannel#dexterous.com/flutter/local_notifications(10962):   at android.os.MessageQueue.next(MessageQueue.java:325)
  E/MethodChannel#dexterous.com/flutter/local_notifications(10962):   at android.os.Looper.loop(Looper.java:142)
  E/MethodChannel#dexterous.com/flutter/local_notifications(10962):   at android.app.ActivityThread.main(ActivityThread.java:6494)
  E/MethodChannel#dexterous.com/flutter/local_notifications(10962):   at java.lang.reflect.Method.invoke(Native Method)
  E/MethodChannel#dexterous.com/flutter/local_notifications(10962):   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
  E/MethodChannel#dexterous.com/flutter/local_notifications(10962):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
  E/flutter (10962): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference, null)
  E/flutter (10962): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
  E/flutter (10962): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18)
  E/flutter (10962): &lt;asynchronous suspension&gt;
  E/flutter (10962): #2      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
  E/flutter (10962): #3      AndroidFlutterLocalNotificationsPlugin.show (package:flutter_local_notifications/src/platform_flutter_local_notifications.dart:137:21)
  E/flutter (10962): #4      FlutterLocalNotificationsPlugin.show (package:flutter_local_notifications/src/flutter_local_notifications_plugin.dart:136:13)
  E/flutter (10962): #5      NotificationPlugin.showNotification (package:pig_salang/models/notification_plugin.dart:94:43)
  E/flutter (10962): #6      WelcomeScreen.build.&lt;anonymous closure&gt; (package:pig_salang/screens/welcome_screen.dart:42:36)
  E/flutter (10962): #7      WelcomeScreen.build.&lt;anonymous closure&gt; (package:pig_salang/screens/welcome_screen.dart:41:26)
  E/flutter (10962): #8      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:779:19)
  E/flutter (10962): #9      _InkResponseState.build.&lt;anonymous closure&gt; (package:flutter/src/material/ink_well.dart:862:36)
  E/flutter (10962): #10     GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
  E/flutter (10962): #11     TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:504:11)
  E/flutter (10962): #12     BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:282:5)
  E/flutter (10962): #13     BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:217:7)
  E/flutter (10962): #14     PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:475:9)
  E/flutter (10962): #15     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76:12)
  E/flutter (10962): #16     PointerRouter._dispatchEventToRoutes.&lt;anonymous closure&gt; (package:flutter/src/gestures/pointer_router.dart:122:9)
  E/flutter (10962): #17     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
  E/flutter (10962): #18     PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:120:18)
  E/flutter (10962): #19     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:106:7)
  E/flutter (10962): #20     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19)
  E/flutter (10962): #21     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
  E/flutter (10962): #22     GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
  E/flutter (10962): #23     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
  E/flutter (10962): #24     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
  E/flutter (10962): #25     _rootRunUnary (dart:async/zone.dart:1196:13)
  E/flutter (10962): #26     _CustomZone.runUnary (dart:async/zone.dart:1085:19)
  E/flutter (10962): #27     _CustomZone.runUnaryGuarded (dart:async/zone.dart:987:7)
  E/flutter (10962): #28     _invoke1 (dart:ui/hooks.dart:275:10)
  E/flutter (10962): #29     _dispatchPointerDataPacket (dart:ui/hooks.dart:184:5)
  E/flutter (10962): 
  </code></pre>
  <p>As far as I have researched, the similar errors were shown because of the <strong>icon</strong>. I have added used every possible way to add icons, but it is not throwing the error constantly. Obviously, I rerun the app after each changes, to make sure I don't get the error.</p>
  <p>My code looks like:</p>
  <pre><code>initializePlatformSpecifics() {
      var initializeAndroidSettings = AndroidInitializationSettings('app_icon'); &lt;--- Here
      var initializeIOSSettings = IOSInitializationSettings(
        requestAlertPermission: false,
        requestBadgePermission: true,
        requestSoundPermission: true,
        onDidReceiveLocalNotification: (id, title, body, payload) async {
          ReceivedNotification receivedNotification = ReceivedNotification(
              id: id, title: title, body: body, payload: payload);
          didReceivedLocalNotificationSubject.add(receivedNotification);
        },
      );
  
      initializeSettings = InitializationSettings(
          initializeAndroidSettings, initializeIOSSettings);
    }
  </code></pre>
  <p>I followed the <a href="https://youtu.be/PJ_AH61dTIc" rel="nofollow noreferrer">tutorial</a>. The thing is when I try to show the notification, it shows the above traceback.
  <a href="https://i.stack.imgur.com/C3lxY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C3lxY.png" alt="Snapshot" /></a></p>
  <p>I made notification icons in Android Studio -&gt; app -&gt; main -&gt; res -&gt; Image Asssets -&gt; Notifications icon, then I made icon with name <code>app_icon</code> which I used to intialize the notification.</p>
  <p>As it was not working, I also tried :</p>
  <pre><code>var initializeAndroidSettings = AndroidInitializationSettings('@mipmap/ic_launcher');
  </code></pre>
  <p>It also did not work. Any help would be appreciated!!!</p>