0

I am getting the following error after installing and configuring the react-native-firebase library.

PS. App path is dummy

Task :app:compileDebugJavaWithJavac root\android\MainApplication.java:14: error: package io.invertase.firebase does not exi st import io.invertase.firebase.RNFirebasePackage;

root\android\MainApplication.java:29: error: cannot find symbol new RNFirebasePackage(), ^ symbol: class RNFirebasePackage not found

Sankalp
  • 76
  • 1
  • 8
  • Try react native link with the firebase. Also change the packagge version from thr gradle files – Madhur May 24 '18 at 12:39
  • @madhur already have tried that all ..then after came here. – Sankalp May 28 '18 at 05:33
  • Try to follow the steps manually by adding importing RNFirebasePackage() to the android files and the reset cache, this should work – Madhur May 28 '18 at 05:50

3 Answers3

1

write this line into your MainApplication.java file

import io.invertase.firebase.RNFirebasePackage;

and follow this steps RNFirebase

hope you will get the solution....

Kishan Gujarati
  • 955
  • 10
  • 15
0

Sometimes React native not able to load the recent installed module, You need to Reset the cache and restart the npm module for enabling the modules in react-native ---> node_modules folder

Follow command

react-native start --reset-cache

And made the bundle file again follow command:

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

Then restart the command it will work

react-native run-android

Make sure you have import this module properly in component file.

Madhur
  • 1,702
  • 4
  • 23
  • 39
0

Edit MainApplication.java file as follows:

  1. Import this line

     import io.invertase.firebase.app.ReactNativeFirebaseAppPackage;
    
  2. Add ReactNativeFirebaseAppPackage() in package list

       @Override
     protected List<ReactPackage> getPackages() {
       List<ReactPackage> packages = new PackageList(this).getPackages();
       packages.add(new ModuleRegistryAdapter(mModuleRegistryProvider));
       packages.add(new ReactNativeFirebaseAppPackage());  // Add This line 
       return packages;
     }
    

This will solve your issue definitely.

Vishal Chavan
  • 334
  • 3
  • 3