Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native-firebase install - package io.invertase.firebase does not exist?

I am getting the following issues when running "react-native run-android" in my project. I've gone through the react-native-firebase per normal but in this case I can't quite see what I might have done wrong?

:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/source/myapp/android/app/src/main/java/com/gctodo/MainApplication.java:11: error: package io.invertase.firebase does not exist
import io.invertase.firebase.RNFirebasePackage;
                            ^
/source/myapp/android/app/src/main/java/com/gctodo/MainApplication.java:12: error: package io.invertase.firebase.auth does not exist
import io.invertase.firebase.auth.RNFirebaseAuthPackage;
                                 ^
/source/myapp/android/app/src/main/java/com/gctodo/MainApplication.java:13: error: package io.invertase.firebase.firestore does not exist
import io.invertase.firebase.firestore.RNFirebaseFirestorePackage;
                                      ^
/source/myapp/android/app/src/main/java/com/gctodo/MainApplication.java:30: error: cannot find symbol
          new RNFirebasePackage(),
              ^
  symbol: class RNFirebasePackage
/source/myapp/android/app/src/main/java/com/gctodo/MainApplication.java:31: error: cannot find symbol
          new RNFirebaseAuthPackage(),
              ^
  symbol: class RNFirebaseAuthPackage
/source/myapp/android/app/src/main/java/com/gctodo/MainApplication.java:32: error: cannot find symbol
          new RNFirebaseFirestorePackage()
              ^
  symbol: class RNFirebaseFirestorePackage
6 errors
:app:compileDebugJavaWithJavac FAILED

MainApplication.java is for exampe:

package com.gctodo;

import android.app.Application;

import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;

import io.invertase.firebase.RNFirebasePackage;
import io.invertase.firebase.auth.RNFirebaseAuthPackage;
import io.invertase.firebase.firestore.RNFirebaseFirestorePackage;

import java.util.Arrays;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    public boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          new RNFirebasePackage(),
          new RNFirebaseAuthPackage(), 
          new RNFirebaseFirestorePackage() 
      );
    }

    @Override
    protected String getJSMainModuleName() {
      return "index";
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }
}
like image 979
Greg Avatar asked Dec 05 '17 21:12

Greg


1 Answers

running react-native link did not work for me. I had to delete the android and ios project folders and then ran

react-native eject

which recreated both the ios and android folders. I was able to run the builds now.

like image 57
Bob Aleena Avatar answered Oct 13 '22 20:10

Bob Aleena