React-native-firebase: Cannot set up firebase on android react native 0.60.3

Created on 24 Jul 2019  路  6Comments  路  Source: invertase/react-native-firebase


Issue



I tried to set up firebase for my React native app version 0.60.0 but I ran into bugs on android. Anyone made it work, please help me out.


Project Files






iOS

Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like:

# N/A
#### `AppDelegate.m`:
// N/A


Android

Click To Expand

#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [ ] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [ ] I am using the NPM package `jetifier` for react-native compatibility? #### `android/build.gradle`: classpath 'com.google.gms:google-services:4.2.0' #### `android/app/build.gradle`: implementation "com.google.android.gms:play-services-base:16.1.0" implementation "com.google.firebase:firebase-core:16.0.9" implementation "com.google.firebase:firebase-messaging:18.0.0" implementation 'me.leolin:ShortcutBadger:1.1.21@aar' apply plugin: 'com.google.gms.google-services' #### `android/settings.gradle`:

// N/A
#### `MainApplication.java`: protected List getPackages() { @SuppressWarnings("UnnecessaryLocalVariable") List packages = new PackageList(this).getPackages(); // Packages that cannot be autolinked yet can be added manually here, for example: // packages.add(new MyReactNativePackage()); packages.add(new RNFirebaseMessagingPackage()); packages.add(new RNFirebaseNotificationsPackage()); return packages; } #### `AndroidManifest.xml`:


Environment

Click To Expand

**`react-native info` output:**

 OUTPUT GOES HERE
- **Platform that you're experiencing the issue on**: - [ ] iOS - [ ] Android - [ ] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [ ] Both - **`react-native-firebase` version you're using that has this issue:** - `e.g. 5.4.3` - **`Firebase` module(s) you're using that has the issue:** - `e.g. Instance ID` - **Are you using `TypeScript`?** - `Y/N`




Think react-native-firebase is great? Please consider supporting all of the project maintainers and contributors by donating via our Open Collective where all contributors can submit expenses. [Learn More]

Screen Shot 2019-07-24 at 4 26 36 PM

Most helpful comment

@mikehardy , i tested it on ios. didn't try it on android after that.
with RNFB v6 still in alpha, and RN 0.60 autolinking , lot of developers facing issues integrating RNFB with RN.
It will be great if the documentation of either v5 or v6 has some clear installation steps on RN 0.60

All 6 comments

Sure, just clone this repo https://github.com/mikehardy/rnfbdemo and run RNVERSION=60 ./make-demo.sh - works

The problem you are having is you didn't use compatible versions https://rnfirebase.io/docs/v5.x.x/getting-started#Supported-versions---React-Native-/-Firebase

v5.4 + AndroidX -> no go (well maybe no go)
v5.4 + new firebase SDK libraries -> definitely no go

Sure, just clone this repo https://github.com/mikehardy/rnfbdemo and run RNVERSION=60 ./make-demo.sh - works

The problem you are having is you didn't use compatible versions https://rnfirebase.io/docs/v5.x.x/getting-started#Supported-versions---React-Native-/-Firebase

v5.4 + AndroidX -> no go (well maybe no go)
v5.4 + new firebase SDK libraries -> definitely no go

this repo is not working for rn 0.60.4 .
the build fails

Which build @creative-git ? I just updated it recently and it was working for me. Maybe open an issue + PR on that repo

@creative-git - maybe it was an iOS build you had issues with, I had finished updating rnfbdemo for RN60+Android but wasn't quite done with iOS. It's fully updated / and appears to work for me now? https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh

@mikehardy , i tested it on ios. didn't try it on android after that.
with RNFB v6 still in alpha, and RN 0.60 autolinking , lot of developers facing issues integrating RNFB with RN.
It will be great if the documentation of either v5 or v6 has some clear installation steps on RN 0.60

I agree - PRs are welcome, there's an edit button on every documentation page

Was this page helpful?
0 / 5 - 0 ratings