The named parameter 'onSelectNotification' isn't defined
The named parameter 'onSelectNotification' isn't definedShort answer
The plugin replaced its callbacks in version 10. Replace onSelectNotification with onDidReceiveNotificationResponse, and add onDidReceiveBackgroundNotificationResponse for actions handled in the background. On iOS settings, delete onDidReceiveLocalNotification, which was removed in version 18.
Fix it fast
1Find out which cause you have
Find which version of the plugin you resolved, then match the error to the cause below.
flutter pub deps | grep flutter_local_notifications2Match what you see, then jump to its fix
What does the error look like?
The named parameter 'onSelectNotification' isn't definedThe named parameter 'onDidReceiveLocalNotification' isn't defined
Cause 1 of 2
onSelectNotification was replaced in version 10
1Check
Your code was written for the old API, and the plugin version in pubspec.lock is newer.
grep -rn "onSelectNotification" lib/2Fix
Use onDidReceiveNotificationResponse in initialize. It runs while the app is running. Actions that do not show the UI go to onDidReceiveBackgroundNotificationResponse, which runs on a background isolate and needs a function marked as an entry point.
@pragma('vm:entry-point')
void notificationTapBackground(NotificationResponse response) {
// handle the action without UI
}
await flutterLocalNotificationsPlugin.initialize(
settings: initializationSettings,
onDidReceiveNotificationResponse: (NotificationResponse response) {
// open the screen for response.payload
},
onDidReceiveBackgroundNotificationResponse: notificationTapBackground,
);3Verify
Analyze, then tap a notification and check that the callback runs.
flutter analyzeConfirmed by pub.dev
Cause 2 of 2
onDidReceiveLocalNotification was removed in version 18
1Check
The callback only mattered on iOS older than 10, so the plugin dropped it with no replacement.
grep -rn "onDidReceiveLocalNotification" lib/2Fix
Delete the argument from DarwinInitializationSettings.
const DarwinInitializationSettings iosSettings =
DarwinInitializationSettings(
requestAlertPermission: true,
requestBadgePermission: true,
requestSoundPermission: true,
);3Verify
Analyze again.
flutter analyzeConfirmed by pub.dev
How do I stop it coming back?
- Read the plugin's changelog before raising its major version.
- Pin the major version in pubspec.yaml and upgrade on purpose.
- Keep notification setup in one file.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
- Qist BazaarA buy-now-pay-later marketplace built from a blank repo, now past 100K downloads on Google Play.
Related fixes
Mobile apps
Scheduled flutter_local_notifications never appear when the app is closed
zonedSchedule does nothing, with no error shown
Local notifications are scheduled with the system, so they should fire while the app is closed.
5 causes, each with a fixMobile apps
Google Play says the app does not support 16 KB memory pages
check_elf_alignment.sh reports UNALIGNED for a library under lib/arm64-v8a
Google Play requires apps that target Android 15 or higher and ship native .so libraries to run on devices with 16 KB memory pages; from 1 February 2027 it will block updates that do not.
5 causes, each with a fixMobile apps
Gradle cannot find com.google.firebase:firebase-analytics-ktx
Required by: project :app
Firebase moved the Kotlin extensions into the main modules and stopped releasing the -ktx modules in July 2025.
2 causes, each with a fixMobile apps
Gradle cannot create LibraryVariantBuilderImpl in a Flutter Android build
Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl
This error appears when the Android Gradle plugin (AGP) cannot run in the Gradle or IDE you use.
3 causes, each with a fixMobile apps
Flutter release build cannot open the keystore: HmacPBESHA256 not available
Algorithm HmacPBESHA256 not available
The keystore is a PKCS12 file protected by a newer algorithm than the Java that is reading it understands.
3 causes, each with a fixMobile apps
Android install error: the package conflicts with an existing package of the same name
The package conflicts with an existing package by the same name
Android allows only one app per application ID, and an update must be signed with the same certificate as the installed version.
3 causes, each with a fix