"MissingPluginException(No implementation found for method show on channel dexterous.com/flutter/local_notifications)" error in flutter.

11.10.2020 14:50

"MissingPluginException(No implementation found for method show on channel dexterous.com/flutter/local_notifications)" error in flutter.

While using firebase cloud messaging in Flutter, I encountered this error after installing the flutter local notifications package that I want to use to customize my notifications. The error was happening when I wanted to get notifications while the app was closed.

I tried many methods for the solution but could not find a solution. Later, in a solution I saw, I wanted to try adding a package that I had seen before, but did not need to add it, and my problem was solved.

The steps you should take to fix the problem are as follows.

1. First of all, you need to add path_provider package to your pubspec.yaml file.

2. Then you need to update the Application.java file you created as follows.

package tr.com.yavuzceliker.test; // Your app package name

import io.flutter.app.FlutterApplication;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;
import io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin;

public class Application extends FlutterApplication implements PluginRegistrantCallback {
@Override
public void onCreate() {
super.onCreate();
FlutterFirebaseMessagingService.setPluginRegistrant(this);
}

@Override
public void registerWith(PluginRegistry registry) {

io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"));
io.flutter.plugins.pathprovider.PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin"));
com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.registerWith(registry.registrarFor("com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin"));
}
}

3. Make sure that the following command is written inside the Activity tag in the AndroidManifest.xml file.

<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

4. Make sure that the following command is written after the Activity tag is finished in the AndroidManifest.xml file.

<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver"></receiver>
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"></action>
</intent-filter>
</receiver>

5. After performing the necessary update, you can restart your project after applying the flutter clean command.