我正在尝试使用flutter_local_notifications插件向我的应用添加通知,但是AndroidInitializationSettings需要可绘制的资源,如果未提供该资源,则会引发此错误:
"PlatformException (PlatformException(INVALID_ICON, The resource could not be found. Please make sure it has been added as a drawable resource to your Android head project., null))"
问题是我不知道Android head项目在哪里。
答案 0 :(得分:14)
希望您已经通过上述回答的方法解决了问题,但是我已经通过使用现有应用图标解决了另一种方法。
var initializationSettingsAndroid =
new AndroidInitializationSettings('@mipmap/ic_launcher');
答案 1 :(得分:1)
将图标添加到[projectFolder]/android/app/src/main/res/drawable
(例如app_icon.png
)并在此处使用该名称:
var initializationSettingsAndroid =
new AndroidInitializationSettings('app_icon');