react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

Firebase app has not been initialized...

Open ektasahu027 opened this issue 8 years ago • 4 comments

Here is the error

screenshot_2018-07-27-14-13-45 1

dependencies are


dependencies {
   // compile project(':react-native-firebase')
  compile(project(':react-native-firebase')) {
         transitive = false
     }
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules
    compile 'com.android.support:multidex:1.0.1'

         compile "com.google.firebase:firebase-firestore:17.0.2"


           compile "com.google.android.gms:play-services-base:11.6.2"
     compile "com.google.firebase:firebase-core:11.6.2"
     compile "com.google.firebase:firebase-analytics:11.6.2"
        compile "com.google.firebase:firebase-auth:11.6.2"
        compile 'com.google.firebase:firebase-database:11.6.2'
          compile 'com.google.firebase:firebase-storage:11.6.2'
 
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}
 apply plugin: 'com.google.gms.google-services'

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
                   classpath 'com.google.gms:google-services:3.1.2'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
           maven { url 'https://maven.google.com' }
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}

ektasahu027 avatar Jul 27 '18 08:07 ektasahu027

Have you included the .json file from the Firebase console into your project as per the docs? Also if you can, check the logcat messages from Android Studio which will tell you more about what's wrong.

Ehesp avatar Jul 27 '18 17:07 Ehesp

@Ehesp thank you so much i resolve my issue it is shows some dependencies problems when i import my project into android studio than i resolve it now its working...

ektasahu027 avatar Jul 30 '18 05:07 ektasahu027

How you solved the issue, please specify the dependency which you Altered

makesh199 avatar May 14 '19 07:05 makesh199

@makesh199 use the react-native-firebase-starter app as the perfect example of how to get v5 going - clone it and make sure it works in your environment, then in your project follow the docs while looking at the example then do what the starter does in your project. If it still doesn't work, open a fresh issue with full information

mikehardy avatar May 14 '19 12:05 mikehardy