angular - Ionic Cordova 添加原生 Firebase:缺少命令错误
问题描述
Angular 7,Ionic 4.12.0,Cordova:9.0.0 (cordova-lib@9.0.1)。
从https://ionicframework.com/docs/native/firebase添加Firebase
和添加后,
我没有看到在我的 config.xml 中添加了这些插件。FirebaseAuthentication
当我尝试使用 FirebaseAuthentication 中的任何方法时,出现以下错误:
错误:找不到执行代理 :: FirebaseAuthentication :: createUserWithEmailAndPassword
编码:
export class FirebaseGeneralService {
constructor(private _firebaseAuth: FirebaseAuthentication, private firebase: Firebase, private platform: Platform) {
this.init();
}
private async init() {
this.platform.ready().then(
async () => {
await this._firebaseAuth.createUserWithEmailAndPassword("test@test.com", "123456");
}
);
}
}
在我的模块中我添加了providers: [..., Firebase, FirebaseAuthentication]
现在,当我将代码调试到 cordova.js 内部(第 1038 行)时,我遇到了这一行:
return (CommandProxyMap[service] ? CommandProxyMap[service][action] : null);
CommandProxyMap doesnt contain neither `Firebase` or `FirebaseAuthentication`. Ive attached an image showing the line and object content.
我尝试将插件手动添加到 config.xml 文件中:
<plugin name="cordova-plugin-firebase" spec="5.5.0" />
<plugin name="cordova-plugin-firebase-authentication" spec="5.5.1" />
(只是提醒一下,我已经从 CLI 正确安装了它们。Firebase 和 FirebaseAuthentication)。
这是一个运行时错误。
谢谢。
解决方案
你跑了吗
ionic cordova plugin add cordova-plugin-firebase
?
推荐阅读
- databricks - ModuleNotFoundError:当我想在 databricks 中导入 sparkdl 时,没有名为“PIL”的模块
- python - bokeh 2.0 Dropdown 缺失值属性
- python - 如何在每个 Dask 子进程中创建一个数据库连接引擎来并行数千个 sql 查询,而不在每个查询中重新创建引擎
- r - R knitr 的构建代码附录不起作用
- node.js - 纽约市的代码覆盖率对行、语句和函数返回 0%
- r - 问题:使用 r 中的 gbm 函数改进 GBM(梯度提升)模型和 nan 生成的问题。train.fraction 正确设置为 <1
- python - 为什么某些 Python 子模块不会自动导入?
- python - 记录不记录所有脚本
- mysql - 在 laravel 上加入表
- c# - 如何使用c#计算一个句子中的单词数?我刚开始学习这门语言