I followed the Android installation instructions as best as possible but I’m still running into issues just getting things to build. I had been using the firebase web SDK just fine on Android.
android/build.gradle
:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.google.gms:google-services:3.1.0' // some parts of the docs say 3.0.0, others say 3.1.0
}
}
from android/app/build.gradle
:
dependencies {
compile project(':react-native-permissions')
compile project(':react-native-onesignal')
compile project(':bugsnag-react-native')
compile project(':react-native-blur')
compile project(':react-native-image-picker')
compile project(':react-native-view-shot')
compile project(':react-native-spinkit')
compile project(':react-native-svg')
compile project(':react-native-vector-icons')
compile project(':react-native-fetch-blob')
compile project(':react-native-camera')
compile project(':react-native-code-push')
compile project(':react-native-device-info')
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 project(':libs:SalesforceReact') // From node_modules
// RNFirebase required dependencies
compile(project(':react-native-firebase')) {
transitive = false
}
compile "com.google.firebase:firebase-core:11.0.0"
// RNFirebase optional dependencies
compile "com.google.firebase:firebase-auth:11.0.0"
compile "com.google.firebase:firebase-database:11.0.0"
}
// ...
// last line of file is below
apply plugin: 'com.google.gms.google-services'
from android/settings.gradle
:
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
Environment
- Target Platform (e.g. iOS, Android): Android
- Development Operating System (e.g. macOS Sierra, Windows 10): macOS Sierra
- Build tools (Xcode or Android Studio version, iOS or Android SDK version, if relevant):
- React Native version (e.g. 0.45.1): 0.43.4
- RNFirebase Version (e.g. 2.0.2): 2.0.4
Thank you in advance for your help. This library with iOS is working great.
@Ehesp — Thank you! Super helpful.
I first tried to added
Google Play Services
in the SDK manager but that alone didn’t resolve the issue. I then updatedGoogle Repository
from 44 to 57 and that did the trick.Thank you again!