Reputation: 917
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.
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?
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.
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?
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.
Upvotes: 1
Views: 1150
Reputation: 917
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 a day
Upvotes: 2