Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unhandled Exception: MissingPluginException(No implementation found for method initialize on channel awesome_notifications)

i already initialized awesome_notifications plugin in main.dart When i hot restart, in debug console i'm getting this error:

    E/flutter ( 4447): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method initialize on channel awesome_notifications)
E/flutter ( 4447): #0      MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:165
E/flutter ( 4447): <asynchronous suspension>
E/flutter ( 4447): #1      AwesomeNotifications.initialize (package:awesome_notifications/src/awesome_notifications_core.dart:174:18)
E/flutter ( 4447): <asynchronous suspension>
E/flutter ( 4447):
E/flutter ( 4447): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method isNotificationAllowed on channel awesome_notifications)
E/flutter ( 4447): #0      MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:165
E/flutter ( 4447): <asynchronous suspension>

Here's my code :

main.dart

Future<void> main() async {
  WidgetsFlutterBinding();
  await Hive.initFlutter();
  if (!Hive.isAdapterRegistered(AddEventModelAdapter().typeId)) {
    Hive.registerAdapter(AddEventModelAdapter());
  }
  AwesomeNotifications()
      .initialize('resource://drawable/res_notification_app_icon', [
    NotificationChannel(
      channelKey: 'schedule_channel',
      channelName: 'scheduled_channel',
      channelDescription: 'descroiption',
      locked: true,
      importance: NotificationImportance.High,
    ),
  ]);

  runApp(const MyApp());
}
like image 436
Xone Avatar asked May 07 '26 10:05

Xone


1 Answers

Whenever you add a plugin in your pubspec.yaml, you need to stop the app and re-run it again because the plugin contains native code on both platforms.

If it still does not work, then do flutter clean and then flutter run.

like image 146
Jigar Fumakiya Avatar answered May 12 '26 09:05

Jigar Fumakiya