简体   繁体   English

React Native Firebase 身份验证不断失败我已遵循所有必要的步骤

[英]React Native Firebase Auth keeps on failing I have followed all the necessary steps

So I have downloaded react-native-firebase using npm i @react-native-firebase/auth and it is sucessfully registered in my package.json file.所以我已经使用 npm i @react-native-firebase/auth 下载了 react-native-firebase,它已成功注册在我的 package.Z466DEEC76ECDF5FCA6D38571F6324D5 文件中。 I have added the google-services plugin to my android directory as directed by the website.我已按照网站的指示将 google-services 插件添加到我的 android 目录中。 Directory目录

Than after that I have added this line in /android/build.gradle之后我在 /android/build.gradle 中添加了这一行

 classpath 'com.google.gms:google-services:4.3.4'

Than after that I have added the plugin to in /android/app/build.gradle之后我将插件添加到 /android/app/build.gradle

apply plugin: 'com.google.gms.google-services'

Still I am getting error我仍然收到错误

FAILURE: Build completed with 2 failures. FAILURE:构建完成,有 2 次失败。

1: Task failed with an exception. 1:任务因异常而失败。

  • Where: Build file 'F:\Salvador\node_modules@react-native-firebase\auth\android\build.gradle' line: 29其中:构建文件 'F:\Salvador\node_modules@react-native-firebase\auth\android\build.gradle' 行:29

  • What went wrong: A problem occurred evaluating project ':react-native-firebase_auth'.出了什么问题:评估项目“:react-native-firebase_auth”时出现问题。

Could not find the react-native-firebase/app package, have you installed it?找不到 react-native-firebase/app package,你安装了吗?

  • Try: Run with --stacktrace option to get the stack trace.尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.使用 --info 或 --debug 选项运行以获得更多日志 output。 Run with --scan to get full insights.运行 --scan 以获得完整的见解。 ============================================================================== ==================================================== ==============================

2: Task failed with an exception. 2:任务因异常而失败。

  • What went wrong: A problem occurred configuring project ':react-native-firebase_auth'.出了什么问题:配置项目“:react-native-firebase_auth”时出现问题。

compileSdkVersion is not specified. compileSdkVersion 未指定。 Please add it to build.gradle请将其添加到 build.gradle

  • Try: Run with --stacktrace option to get the stack trace.尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.使用 --info 或 --debug 选项运行以获得更多日志 output。 Run with --scan to get full insights.运行 --scan 以获得完整的见解。 ============================================================================== ==================================================== ==============================

  • Get more help at https://help.gradle.orghttps://help.gradle.org获得更多帮助

BUILD FAILED in 46s 46 秒内构建失败

error Failed to install the app.错误 无法安装应用程序。 Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup .确保您已设置 Android 开发环境: https://reactnative.dev/docs/environment-setup Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081错误:命令失败:gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build completed with 2 failures. FAILURE:构建完成,有 2 次失败。

1: Task failed with an exception. 1:任务因异常而失败。

  • Where: Build file 'F:\Salvador\node_modules@react-native-firebase\auth\android\build.gradle' line: 29其中:构建文件 'F:\Salvador\node_modules@react-native-firebase\auth\android\build.gradle' 行:29

  • What went wrong: A problem occurred evaluating project ':react-native-firebase_auth'.出了什么问题:评估项目“:react-native-firebase_auth”时出现问题。

Could not find the react-native-firebase/app package, have you installed it?找不到 react-native-firebase/app package,你安装了吗?

  • Try: Run with --stacktrace option to get the stack trace.尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.使用 --info 或 --debug 选项运行以获得更多日志 output。 Run with --scan to get full insights.运行 --scan 以获得完整的见解。 ============================================================================== ==================================================== ==============================

2: Task failed with an exception. 2:任务因异常而失败。

  • What went wrong: A problem occurred configuring project ':react-native-firebase_auth'.出了什么问题:配置项目“:react-native-firebase_auth”时出现问题。

compileSdkVersion is not specified. compileSdkVersion 未指定。 Please add it to build.gradle请将其添加到 build.gradle

  • Try: Run with --stacktrace option to get the stack trace.尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.使用 --info 或 --debug 选项运行以获得更多日志 output。 Run with --scan to get full insights.运行 --scan 以获得完整的见解。 ============================================================================== ==================================================== ==============================

  • Get more help at https://help.gradle.orghttps://help.gradle.org获得更多帮助

BUILD FAILED in 46s 46 秒内构建失败

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. info 使用 --verbose 标志运行 CLI 以获取更多详细信息。

For those who are still struggling to find the answer just对于那些仍在努力寻找答案的人

npm i @react-native-firebase/app

and you are good to go.你对go很好。 Took me 6 days:')我花了 6 天时间:')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM