【发布时间】:2023-04-04 15:05:01
【问题描述】:
在过去的几天里,我正在尝试使用 Ionic3、Cordova 和 Firebase 构建和 android apk 文件。由于我对 ionic 很陌生,因此我正在关注在线找到的特定教程,该教程也为我提供了源代码。教程的链接如下:https://www.youtube.com/watch?v=1wU9N7VxoS8&t=1s,是关于向特定设备发送推送通知的。我一步一步按照教程进行操作,它似乎工作正常,但是当我尝试构建一个 apk 文件以便在我的 android 设备上运行它时,我会收到以下错误:
(node:18268) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Invalid data, chunk must be a string or buffer, not object
(node:18268) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
我已经搜索并尝试了不同的方法来修复错误,但它们似乎都不起作用。谁能给我一个解决方案?谢谢
【问题讨论】:
-
尝试删除 fcm 插件然后添加平台,然后再次添加 fcm 插件然后添加平台。希望这会有所帮助
-
我删除了插件,然后删除了平台,然后我再次添加了插件,到目前为止一切都很好,然后我添加了 android 平台,我得到了同样的错误“UnhandledPromiseRejectionWarning: Unhandled Promise Rejection (rejection id: 1): TypeError: Invalid data, chunk must be a string or buffer, not object (node:15772) [DEP0018] DeprecationWarning: Unhandled Promise rejections are deprecated. 未来,未处理的promise拒绝将终止Node.js具有非零退出代码的进程。”当我也尝试构建 android apk 时也是如此
标签: javascript android node.js cordova ionic-framework