Migrate from a Google Project on Android

At Google I/O 2016, we announced Firebase - a new toolkit for building mobile apps. Firebase replaces several existing Google developer technologies, and adds many new services. This guide walks you through the process of updating your apps from projects created using the existing setup tool or Google API console.

You can learn more about Firebase in our documentation. If you're upgrading from an existing Firebase.com project, please see our upgrade guide. If you have trouble migrating, reach out to our developer support.

Migrate your console project

Firebase manages all of your API settings and credentials through a single configuration file. The file is named google-services.json on Android and GoogleService-Info.plist on iOS. It can be downloaded by following the steps below.
  • Add Firebase to a Google Developer Project Go to Firebase console and select Import Google Project.
  • Select an existing project.
  • If using App Invites, select the Dynamic Links panel and accept the warning. This enables Firebase Invites.
  • Configure your project in Firebase:
    1. Click the cog in the left hand menu, and select Project Settings.
    2. For each of your iOS apps, select them and add your app store ID and team ID.
    3. For each app in your project, download updated google-service.json or GoogleService-Info.plist files from the Firebase console. This will contain required information for Google Analytics, Cloud Messaging, and Google Sign In.

Update your Gradle configuration

You'll need to upgrade your dependencies to the latest version, 10.2.6. Dependencies for most Google Play services SDKs remain unchanged when migrating to Firebase. Some services require changes though, as described below.

If you were previously using the google-services Gradle plugin, you'll need to update to version 3.1.0.

If you haven't been using the plugin, add the dependency to your root build.gradle.

buildscript {
    // ...
    dependencies {
        // ...
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

Then in your module Gradle file (usually app/build.gradle) file, add the following line at the bottom of the file to enable the Gradle plugin:

apply plugin: 'com.android.application'

android {
  // ...
}

dependencies {
  // ...
}

// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'

Then copy the google-services.json you downloaded from Firebase console into your module folder (usually /app) at the same level as the Gradle file above.

Upgrade Google App Invites to Firebase Invites

Update the dependency in your build.gradle.

BEFORE
compile 'com.google.android.gms:play-services-appinvite:8.4.0'
AFTER
compile "com.google.firebase:firebase-invites:10.2.6"

To learn more about new features, see the full Firebase Invites documentation.

Upgrade AdMob by Google

Update the dependency in your build.gradle.

BEFORE
compile 'com.google.android.gms:play-services-admob:8.4.0'
AFTER
compile "com.google.firebase:firebase-ads:10.2.6"

Upgrade Google Cloud Messaging (GCM) to Firebase Cloud Messaging (FCM)

You can continue to use your existing GCM integration, but if you want to take advantage of the newer features of Firebase Cloud Messaging you will need to update to FCM: see our full guide to upgrading your Android GCM app to use FCM.

Send feedback about...

Need help? Visit our support page.