Skip to content

Unable to initialize #9

@lobo922

Description

@lobo922

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions