Skip to main content

Manual Installation

Notice

This page is archived and might not reflect the latest version of the FlutterFire plugins. You can find the latest information on firebase.google.com:

https://firebase.google.com/docs/flutter/setup

caution

Manual installation is not the recommended installation flow. These guides are for existing applications using FlutterFire.

In previous versions of FlutterFire, in order to add Firebase to your projects manual platform specific steps were required, such as downloading a google-services.json file for Android, downloading a GoogleService-Info.plist file for iOS or editing your index.html file for web.

FlutterFire now supports initialization from Dart using the FlutterFire CLI.

The new Dart-only initialization is fully backwards compatible with previous versions of FlutterFire - if you have an existing project with manual initialization, this will continue to work.

Platform setup#

If you wish to continue to manually install Firebase on your platforms, please read the following guides:

  1. Android Installation
  2. iOS Installation
  3. MacOS Installation
  4. Web Installation

Migrating to Dart-only initialization#

If you wish to migrate to the Dart-only initialization flow, some steps are required for your existing applications.

caution

Please backup / branch your code before migrating.

Android#

  1. Remove the /android/app/google-services.json file.
  2. Remove the google-services dependency from the /android/build.gradle file:
android/build.gradle
buildscript {
dependencies {
// ... other dependencies
- classpath 'com.google.gms:google-services:4.3.8'
}
}
  1. Remove the plugin execution via the /android/app/build.gradle file:
- apply plugin: 'com.google.gms.google-services'

iOS#

Using Xcode, open the project's ios/Runner.xcworkspace file, then delete the GoogleService-Info.plist file located in the file browser.

macOS#

Using Xcode, open the project's macos/Runner.xcworkspace file, then delete the GoogleService-Info.plist file located in the file browser.

Web#

  1. Remove any Firebase SDK scripts from your web/index.html file, for example:
web/index.html
<html>
...
<body>
- <script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js"></script>
- <script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-firestore.js"></script>
<script src="main.dart.js" type="application/javascript"></script>
</body>
</html>
  1. Remove any firebase.initializeApp() logic and configuration from the web/index.html file:
web/index.html
<html>
...
<body>
<script>
- var firebaseConfig = { ... };
- firebase.initializeApp(firebaseConfig);
</script>

Overriding Firebase SDK Versions#

FlutterFire internally sets the versions of the Firebase SDKs that each module uses. Each release is tested against a fixed set of SDK version to ensure everything works as expected.

If you wish to change these versions, you can manually override the native SDK versions

Android#

In the /android/app/build.gradle file, you can provide your own versions using the options shown below:

rootProject.ext {
set('FlutterFire', [
FirebaseSDKVersion: '29.3.1'
])
}

iOS/macOS#

Open your /ios/Podfile or /macos/Podfile file and add any of the globals below to the top of the file:

# Override Firebase SDK Version
$FirebaseSDKVersion = '8.15.0'