6

So I was working with my React Native application and had to install react-native firebase storage for image storing. So I ran npm install @react-native-firebase/storage after installing it I re-run my server and after that, I am getting this error. I don't know why I am getting this error. Kindly help me out.

Getting this error:

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.

When I run my server I get this error

info Run CLI with --verbose flag for more details.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] android: `react-native run-android`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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

1 Answer 1

5

If anyone else is getting this error what you need to do is open your react native android folder in Android Studio and then build and run your application via Android Studio. It will successfully run the project after that close Android Studio and now again start your react native project.

Now you will get 0 errors.

Also, run npm outdated after running that try upgrading your outdated packages also as my storage version was 12.0 but auth and app of firebase was 11.2.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.