安装 React Native Firebase 存储后出现错误

Abd*_*hid 6 javascript firebase reactjs react-native

因此,我正在使用 React Native 应用程序,并且必须安装 React-Native Firebase 存储来存储图像。所以我在安装后运行npm install @react-native-firebase/storage我重新运行我的服务器,之后,我收到此错误。我不知道为什么我会收到此错误。请帮助我。

出现此错误:

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
F:\Salvador\node_modules\@react-native-firebase\storage\android\src\main\java\io\invertase\firebase\storage\ReactNativeFirebaseStorageModule.java:234: error: cannot find symbol
    firebaseStorage.useEmulator(host, port);
                   ^
  symbol:   method useEmulator(String,int)
  location: variable firebaseStorage of type FirebaseStorage
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-firebase_storage:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 12s

    at makeError (F:\Salvador\node_modules\execa\index.js:174:9)
    at F:\Salvador\node_modules\execa\index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async runOnAllDevices (F:\Salvador\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
    at async Command.handleAction (F:\Salvador\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:186:9)
info Run CLI with --verbose flag for more details.
Run Code Online (Sandbox Code Playgroud)

当我运行我的服务器时,我收到此错误

info Run CLI with --verbose flag for more details.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Salvador@0.0.1 android: `react-native run-android`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Salvador@0.0.1 android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Home\AppData\Roaming\npm-cache\_logs\2021-06-02T14_16_46_571Z-debug.log
Run Code Online (Sandbox Code Playgroud)

Abd*_*hid 5

如果其他人收到此错误,您需要做的是在 Android Studio 中打开您的 React Native Android 文件夹,然后通过 Android Studio 构建并运行您的应用程序。关闭 Android Studio 后它将成功运行该项目,现在再次启动您的 React Native 项目。

现在你会得到 0 个错误。

另外,运行后运行npm outdated尝试升级过时的软件包,因为我的存储版本是 12.0,但 firebase 的身份验证和应用程序是 11.2。