diff --git a/flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/FlutterLocalNotificationsPlugin.java b/flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/FlutterLocalNotificationsPlugin.java index 4bf284b17..bd3bbd9ea 100644 --- a/flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/FlutterLocalNotificationsPlugin.java +++ b/flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/FlutterLocalNotificationsPlugin.java @@ -2130,11 +2130,16 @@ private HashMap getMappedNotificationChannel(NotificationChannel channelPayload.put("sound", resource); } else { // Kept for backwards compatibility when the source resource used to be based on id - String resourceName = - applicationContext.getResources().getResourceEntryName(resourceId); - if (resourceName != null) { - channelPayload.put("soundSource", soundSources.indexOf(SoundSource.RawResource)); - channelPayload.put("sound", resourceName); + try { + String resourceName = + applicationContext.getResources().getResourceEntryName(resourceId); + if (resourceName != null) { + channelPayload.put("soundSource", soundSources.indexOf(SoundSource.RawResource)); + channelPayload.put("sound", resourceName); + } + } catch (Exception e) { + channelPayload.put("sound", null); + channelPayload.put("playSound", false); } } } else {