Skip to main content

How to create project

Step 1: Create project​

Step 2: Get google-services.json​

  • Click on the corresponding app to add app

Android

  1. Input package name
  2. Download google-services.json, place at android/app

Step 3: Add firebase SDK​

  1. Open app/build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
// add this line
apply plugin: 'com.google.gms.google-services'
// ...

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// add this line
implementation platform('com.google.firebase:firebase-bom:32.1.1')
}
tip

Usually, you need to add two lines apply plugin, and implementation platform...

  1. Open build.gradle
buildscript {  
repositories {
// Make sure that you have the following two repositories
google() // Google's Maven repository

mavenCentral() // Maven Central repository

}
dependencies {
...
// Add the dependency for the Google services Gradle plugin
classpath 'com.google.gms:google-services:4.3.15'
}
}

allprojects {
...
repositories {
// Make sure that you have the following two repositories
google() // Google's Maven repository

mavenCentral() // Maven Central repository

}
}
tip

Usually, you only need to change only 1 line at classpath