![](/img/trans.png)
[英]You attempted to use a firebase module that's not installed on your android project by calling firebase.storage()
[英]"You attempted to use a firebase module that's not installed on your Android project by calling firebase.app()."
我按照https://rnfirebase.io/#managed-workflow指南了解如何安装 Firebase。 我创建了一个新的 Expo 应用程序:
npx create-react-native-app -t with-dev-client
如指南中所写。 然后我做了
npx expo install @react-native-firebase/auth
除了一个按钮,在项目中什么都没有,当按下它时,它会创建一个带有 createUserWithEmailAndPassword 的帐户。
这是当我遇到此错误时:
错误:您试图通过调用 firebase.app() 来使用未安装在 Android 项目上的 firebase 模块。 确保您拥有:
- 在“MainApplication.java”文件中导入了“io.invertase.firebase.app.ReactNativeFirebaseAppPackage”模块。
- 在 RN 'getPackages()' 方法列表中添加了 'new ReactNativeFirebaseAppPackage()' 行。 有关完整设置说明,请参阅http://invertase.link/android 。
我是不是在路上搞砸了,或者是否有比指南建议的更多的步骤,或者是我创建应用程序的方式导致的?
这是在 Android 仿真器上测试的,通过在终端中按“a”启动。
我很感激任何帮助!
您需要安装@react-native-firebase/app
模块并初始化,然后只有您可以使用任何@react-native-firebase/xxx
模块。 在此处查看授权模块的官方文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.