Versions

  • Android 3.2
  • React-Native >= 0.57
  • Gradle build: 3.2.1

If you encounter any build errors on Android and React-native, most probably node modules are not downloaded properly. The repositories defined in gradle build are not available. To fix this simple edit

// Edit: /android/build.gradle 

buildscript {
  ext {
    ...
  }
  repositories {
    google()
    jcenter()
    maven {
      url 'https://maven.fabric.io/public'
    }
  }
  dependencies {
    ...
  }
}

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

Basically, we will prioritize google repositories to download the firebase libraries.

Leave a Reply

Your email address will not be published. Required fields are marked *