React-native-firebase: RNFirebase core module was not found natively on Android

Created on 5 Jan 2018  路  8Comments  路  Source: invertase/react-native-firebase

Issue

RNFirebase core module was not found natively on Android

https://github.com/invertase/react-native-firebase#supported-versions---react-native--firebase
table shows I've to use 11.6.2 for react-native 0.51

although node_modules/react-native-firebase/android/build.gradle has
buildscript {
ext.firebaseVersion = '11.4.2'
}

Is that a problem?

  • android/build.gradle
 buildscript {
     repositories {

  dependencies {
    classpath 'com.google.gms:google-services:3.1.2'
 }
}


project.ext.react = [
     entryFile: "index.js"
 ]

 apply from: "../../node_modules/react-native/react.gradle"



allprojects {
  repositories {

         maven { url "$rootDir/../node_modules/react-native/android" }

         maven {
             url 'https://maven.google.com'
         }
  }
}

  • android/app/build.gradle
 dependencies {
     compile(project(':react-native-firebase')) {
         transitive = false
     }
     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.facebook.react:react-native:+"  // From node_modules
}

 apply plugin: 'com.google.gms.google-services'

  • main application
   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 AutoHeightWebViewPackage(),
           new RNFirebaseAnalyticsPackage()
                                            );
       }

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

  • settings.grade
include ':react-native-firebase'
 project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')


  • gradle.properties
 ANDROID_BUILD_TARGET_SDK_VERSION=23
 ANDROID_BUILD_SDK_VERSION=23

 ANDROID_BUILD_TOOLS_VERSION=23.0.1

 ANDROID_BUILD_MIN_SDK_VERSION=16


  • package.json
     "react": "^16.0.0",
     "react-native": "^0.51.0",
    "react-native-firebase": "^3.2.0",

Environment

  1. Application Target Platform:
    android

  1. Development Operating System:
    macOS Sierra

  1. Build Tools:

  1. React Native version:
    0.51

  1. RNFirebase Version:
    3.2

  1. Firebase Module:
    core, analytics

Most helpful comment

I have same issue. RN + Expo. How to fix this !

All 8 comments

I found

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

code inside the function never gets executed .. is this normal?

@littlehome-eugene, have you solved this issue? How? I have the same problem with my releasebuld, but not with dev.

RN 0.51, Expo SDK 24.0.0, RNFirebase 3.2.1, Firebase Android SDK 11.8.0

Outside the MainApplication Class, there is another method as 'getPackages()'. You should add the additional packages there if you require them.

It solved the Issue for me.
I hope this helps.

 protected List<ReactPackage> getPackages() {
        // Add additional packages you require here
        // No need to add RnnPackage and MainReactPackage
        return Arrays.<ReactPackage>asList(
            // eg. new VectorIconsPackage()
                new RNFirebasePackage(),
                new RNFirebaseDatabasePackage(),
                new RNFirebaseAdMobPackage(),
                new RNFirebaseAuthPackage()
        );
    }

I have this issue as well, how did you solve it?

I have same issue. RN + Expo. How to fix this !

I also run to this issue guys, How do I fix this? any help would be much appreciated.. thanks
@littlehome-eugene @dmacmillan @steelx

Thanks for the quick feedback, I looked at the #738, however i'm running it on android not ios, I even created a new react-native project and followed the instructions for integrating react-native-firebase and also checked out their supported react-native versions but I still get the error: RNFirebase core module was not found natively on android even on the new clean project... what do I do now? @littlehome-eugene

Was this page helpful?
0 / 5 - 0 ratings

Related issues

escobar5 picture escobar5  路  3Comments

jonaseck2 picture jonaseck2  路  3Comments

n-scope picture n-scope  路  3Comments

csumrell picture csumrell  路  3Comments

NordlingDev picture NordlingDev  路  3Comments