flutter_local_notifications : "PlatformException (PlatformException(INVALID_ICON, 找不到资源))

标签 flutter

我正在尝试使用 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项目在哪

最佳答案

希望你已经用上面回答的方法解决了它,但我已经用现有的应用程序图标用另一种方法解决了。

var initializationSettingsAndroid =
    new AndroidInitializationSettings('@mipmap/ic_launcher');

关于flutter_local_notifications : "PlatformException (PlatformException(INVALID_ICON, 找不到资源)),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55820299/

相关文章:

python - 使用starflut在flutter中导入python模块

flutter - 是否可以在 flutter 中为 git 包设置版本约束?

flutter - 如何计算并获得 Dart 和 Dart 中指定值的列表

flutter - 如何平移和缩放图像?

flutter - 为什么在 Flutter 测试期间使用 rootBundle.load 会得到 "Null check operator used on a null value"?

firebase - 如何使用 Firestore 进行实时位置更新?

android - native Checkout Paypal 按钮未在 android 中为发布 apk 呈现

json - Flutter:JSON数据,列表在列表下

dart - 当小部件被路由到/远离时的类回调函数

dart - 列 mainAxisSize : MainAxisSize. 分钟不工作