0

I'm doing google/facebook login in react native with firebase. When i trying to open it in android studio and got this error in 3rd step of integrate firebase in android ref

here is the error

Ramsha Omer
  • 1,022
  • 1
  • 8
  • 28
  • Does this answer your question? [Android Studio suddenly cannot resolve symbols](https://stackoverflow.com/questions/21100688/android-studio-suddenly-cannot-resolve-symbols) – Laura Dec 02 '19 at 04:07
  • i have try but not work, when i open project structure Prem appear(1): Project PetShop: project SDK is not defined – Phạm Huy Hoàng Dec 02 '19 at 04:36

1 Answers1

-1

I recommend you to use react-native-firebase SDK from invertase. This simplifies all the integrations. I will narrow down the steps which are required to integrate firebase authentication to an existing react-native project for android.

  • We can use yarn for installing react-native-firebase. Enter below commands one by one in the project directory.
    yarn add @react-native-firebase/app
    yarn add @react-native-firebase/auth
    yarn install
  • Download the google-services.json file and paste it into /android/app/. (Your package name in google-services.json should be similar as the package name included in android/app/src/main/java/com/(ProjectName)/MainApplication.java
  • Add the below line to android/build.gradle in dependencies as shown.
    classpath 'com.google.gms:google-services:4.3.2'

    dependencies { classpath("com.android.tools.build:gradle:3.4.2") classpath 'com.google.gms:google-services:4.3.2' }

  • Add the below line to the bottom of android/app/build.gradle file.
    apply plugin: 'com.google.gms.google-services'

Now run the project and it should be working fine.