Step 1
- go to firebase console website
- login with google account
- create new project by add project
- enter project name
- enable google analytics then continue
- select / Choose account for analytics
- create project
Step 2
- Open created Project in firebase
- select Development Type (Android , ios , Flutter , web etc...)
Firebase Setup for Android
- Package Name
- In Android Studio, open
appmodule’s Gradle file: - Groovy:
app/build.gradle - Kotlin DSL:
app/build.gradle.kts - Copy the value of
applicationId(your Package Name) - Paste it into Firebase console
- Nickname
- Give your app a cute little nickname so you can recognize it later
- SHA-1 Key
- Press
Ctrltwice in Android Studio - Search for
gradlew signingReportand run it in Terminal - Copy the SHA-1 from the output and paste it in Firebase
- Register
- Click Register App like a responsible adult
- Add google-services.json
- Download from Firebase
- In Android Studio → Project view
- Paste into:
app/folder
(the Android view hides it because it enjoys watching you suffer)
- Add Firebase SDK
If your project uses Groovy build scripts
Project-level
build.gradle → in dependencies:classpath 'com.google.gms:google-services:4.4.0'
App-level
build.gradle:apply plugin: 'com.google.gms.google-services' dependencies { implementation platform('com.google.firebase:firebase-bom:33.5.1') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-auth' }
If your project uses Kotlin DSL .kts build scripts
Project-level
build.gradle.kts:plugins { id("com.google.gms.google-services") version "4.4.0" apply false }
App-level
build.gradle.kts:plugins { id("com.android.application") id("com.google.gms.google-services") } dependencies { implementation(platform("com.google.firebase:firebase-bom:33.5.1")) implementation("com.google.firebase:firebase-analytics") implementation("com.google.firebase:firebase-auth") }
Make sure repositories exist (if not, add):
dependencyResolutionManagement { repositories { google() mavenCentral() } }
- Sync Project
- Gradle spins for a while
- You pretend everything is under control
- Internet Permission
Add this in
AndroidManifest.xml above <application>:<uses-permission android:name="android.permission.INTERNET" />