firebase - 无法读取 Ionic 中未定义错误的属性“清单”
问题描述
我正在尝试使用 Firebase 登录 Facebook。我已经安装了所有需要的库并完成了所需的配置。尽管如此,每当我尝试启动我的应用程序时,它都会给我这个错误:
(node:11160) UnhandledPromiseRejectionWarning: TypeError: Cannot read
property 'manifest' of undefined
at removeOldOptions (C:\Users\Dell\Desktop\firebaseapp\plugins\cordova- universal-links-plugin\hooks\lib\android\manifestWriter.js:48:32)ished in 37.33 s
at Object.writePreferences
(C:\Users\Dell\Desktop\firebaseapp\plugins\cordova-universal-links-
plugin\hooks\lib\android\manifestWriter.js:27:19)
at activateUniversalLinksInAndroid
(C:\Users\Dell\Desktop\firebaseapp\plugins\cordova-universal-links-plugin\hooks\afterPrepareHook.js:65:25)
at C:\Users\Dell\Desktop\firebaseapp\plugins\cordova-universal-links-plugin\hooks\afterPrepareHook.js:45:11
at Array.forEach (<anonymous>)
at run (C:\Users\Dell\Desktop\firebaseapp\plugins\cordova-universal-links-plugin\hooks\afterPrepareHook.js:41:17)
at module.exports (C:\Users\Dell\Desktop\firebaseapp\plugins\cordova-universal-links-plugin\hooks\afterPrepareHook.js:18:3)
at runScriptViaModuleLoader (C:\Users\Dell\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\hooks\HooksRunner.js:188:18)
at runScript (C:\Users\Dell\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\hooks\HooksRunner.js:164:16)
(node:11160) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
解决方案
能够通过以下更改解决此问题:
只需转到 Ionic 中的以下文件
插件/cordova-universal-links-plugin/hooks/lib/android/manifestWriter.js
我通过更改 pathToManifest 来解决问题,如下所示:
var pathToManifest = path.join(cordovaContext.opts.projectRoot, 'platforms', 'android', 'cordovaLib', 'AndroidManifest.xml');
至
var pathToManifest = path.join(cordovaContext.opts.projectRoot, 'platforms', 'android', 'app', 'src', 'main', 'AndroidManifest.xml');
推荐阅读
- python - 使用 Python 生成所有组合
- javascript - 在处理点击事件方面需要帮助
- c - C中的死编码
- c# - 无法执行右键单击-> 在 azure 功能上部署
- asp.net-core-2.0 - .Net 核心扩展 SeriLog 过滤不起作用
- kubernetes - 无需 kubectl 代理即可访问 Kubernetes Dashboard
- c# - Devexpress TabHeader 消失
- sql - SQL - 将符号的列值转换为以符号作为名称和布尔类型的列
- scala - 如何将 Scala 数组转换为 Java 列表?
- node.js - 使用 splice() 我们可以在不使用 findIndex() 方法的情况下从包含许多 json 对象的数组中删除特定元素吗?