Unable to initialize

I’m trying to initialize Firebase from JS as following:

  1. I configured this module on a clean project
  2. In index.android.js added the line import RNFirebase from ‘react-native-firebase’
  3. In index.android.js i added the following before render():
    componentWillMount() {
    firebase.initizlizeApp({
    apiKey: ‘apikey’,
    authDomain: ‘authdomain’,
    databaseURL: ‘dburl’,
    storageBucket: ‘bucket’,
    messagingSenderId: ‘senderid’
    });
    }
  4. i also tried to do it different as in the example:
    componentWillMount() {
    const firebase = new RNFirebase();
    const configurationOptions = {
    debug: true,
    googleAppID: ‘appid’,
    APIKey: ‘appkey’,
    databaseURL: ‘dburl’,
    storageBucket: ‘bucket’,
    androidClientID: ‘clientid’,
    GCMSenderID: ‘senderid’
    };
    const firebase = new RNFirebase(configurationOptions);
    }

But in both attemps i get the following error on the emulator:
Default FirebaseApp is not initialized in this process com.xxx. Make sure to call FirebaseApp.initializeApp(Context) first. getInstance null:-1 getInstance null:-1 <init> RNFirebaseAuth.java:50 createNativeModules RNFirebasePackage.java:38 processPackage NativeModuleRegistryBuilder.java:88 processPackage ReactInstanceManager.java:950 createReactContext ReactInstanceManager.java:891 access$600 ReactInstanceManager.java:104 doInBackground ReactInstanceManager.java:218 doInBackground ReactInstanceManager.java:197 call AsyncTask.java:304 run FutureTask.java:237 runWorker ThreadPoolExecutor.java:1133 run ThreadPoolExecutor.java:607 run Thread.java:761

Am i doing anything wrong?

1 thought on “Unable to initialize

  1. @victoriafrench That’s an interesting use case that we hadn’t envisaged! At the moment, as you’ve found, the initialisation relies on the GoogleServiceInfo.plist (iOS) and google-services.json (Android) files for configuration information.

    We can certainly look at supporting custom configuration, we’d just been trying to keep it simple at first. Out of interest, are you needing to connect to multiple projects simultaneously? Or is there only one project active at any one time?

Comments are closed.

Unable to initialize

I’m trying to initialize Firebase from JS as following:

  1. I configured this module on a clean project
  2. In index.android.js added the line import RNFirebase from ‘react-native-firebase’
  3. In index.android.js i added the following before render():
    componentWillMount() {
    firebase.initizlizeApp({
    apiKey: ‘apikey’,
    authDomain: ‘authdomain’,
    databaseURL: ‘dburl’,
    storageBucket: ‘bucket’,
    messagingSenderId: ‘senderid’
    });
    }
  4. i also tried to do it different as in the example:
    componentWillMount() {
    const firebase = new RNFirebase();
    const configurationOptions = {
    debug: true,
    googleAppID: ‘appid’,
    APIKey: ‘appkey’,
    databaseURL: ‘dburl’,
    storageBucket: ‘bucket’,
    androidClientID: ‘clientid’,
    GCMSenderID: ‘senderid’
    };
    const firebase = new RNFirebase(configurationOptions);
    }

But in both attemps i get the following error on the emulator:
Default FirebaseApp is not initialized in this process com.xxx. Make sure to call FirebaseApp.initializeApp(Context) first. getInstance null:-1 getInstance null:-1 <init> RNFirebaseAuth.java:50 createNativeModules RNFirebasePackage.java:38 processPackage NativeModuleRegistryBuilder.java:88 processPackage ReactInstanceManager.java:950 createReactContext ReactInstanceManager.java:891 access$600 ReactInstanceManager.java:104 doInBackground ReactInstanceManager.java:218 doInBackground ReactInstanceManager.java:197 call AsyncTask.java:304 run FutureTask.java:237 runWorker ThreadPoolExecutor.java:1133 run ThreadPoolExecutor.java:607 run Thread.java:761

Am i doing anything wrong?

1 thought on “Unable to initialize

  1. @victoriafrench That’s an interesting use case that we hadn’t envisaged! At the moment, as you’ve found, the initialisation relies on the GoogleServiceInfo.plist (iOS) and google-services.json (Android) files for configuration information.

    We can certainly look at supporting custom configuration, we’d just been trying to keep it simple at first. Out of interest, are you needing to connect to multiple projects simultaneously? Or is there only one project active at any one time?

Comments are closed.