【发布时间】:2022-01-22 07:53:12
【问题描述】:
expo 托管应用用户(最新版本)...我们有这个 firebase.js 文件,但无法弄清楚为什么我们一直看到错误
需要看看这个文件有什么问题......如果有的话 - 这让我发疯了!感谢任何反馈/提示
错误: 12:03 错误:您试图通过调用 firebase.app() 来使用未安装在您的 Android 项目上的 firebase 模块。
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app"
import { getFirestore } from '@react-native-firebase/firestore';
import Constants from "expo-constants"
import "@react-native-firebase/auth"
// Should not be used elsewhere in the project
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration -- from firebase console
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: Constants.manifest.extra.apiKey,
authDomain: Constants.manifest.extra.authDomain,
databaseURL: Constants.manifest.extra.databaseURL,
projectId: Constants.manifest.extra.projectId,
storageBucket: Constants.manifest.extra.storageBucket,
messagingSenderId: Constants.manifest.extra.messagingSenderId,
appId: Constants.manifest.extra.appId,
measurementId: Constants.manifest.extra.measurementId,
}
// Initialize Firebase
const Firebase = initializeApp(firebaseConfig)
const firestore = getFirestore();
export default [Firebase, firestore]
【问题讨论】:
标签: firebase react-native expo