简体   繁体   中英

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. I have added the google-services plugin to my android directory as directed by the website. Directory

Than after that I have added this line in /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

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

Still I am getting error

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • Where: Build file 'F:\Salvador\node_modules@react-native-firebase\auth\android\build.gradle' line: 29

  • What went wrong: A problem occurred evaluating project ':react-native-firebase_auth'.

Could not find the react-native-firebase/app package, have you installed it?

  • 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. ==============================================================================

2: Task failed with an exception.

  • What went wrong: A problem occurred configuring project ':react-native-firebase_auth'.

compileSdkVersion is not specified. Please add it to build.gradle

  • 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 46s

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

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • Where: Build file 'F:\Salvador\node_modules@react-native-firebase\auth\android\build.gradle' line: 29

  • What went wrong: A problem occurred evaluating project ':react-native-firebase_auth'.

Could not find the react-native-firebase/app package, have you installed it?

  • 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. ==============================================================================

2: Task failed with an exception.

  • What went wrong: A problem occurred configuring project ':react-native-firebase_auth'.

compileSdkVersion is not specified. Please add it to build.gradle

  • 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 46s

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.

For those who are still struggling to find the answer just

npm i @react-native-firebase/app

and you are good to go. Took me 6 days:')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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