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
Asked
Active
Viewed 1,369 times
0
-
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 Answers
-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.jsonfile and paste it into/android/app/. (Your package name ingoogle-services.jsonshould be similar as the package name included inandroid/app/src/main/java/com/(ProjectName)/MainApplication.java Add the below line to
android/build.gradleindependenciesas 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.gradlefile.
apply plugin: 'com.google.gms.google-services'
Now run the project and it should be working fine.