title | sidebar_label |
---|---|
Manual Installation |
Overview |
:::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.
If you wish to continue to manually install Firebase on your platforms, please read the following guides:
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.
:::
- Remove the
/android/app/google-services.json
file. - Remove the
google-services
dependency from the/android/build.gradle
file:
buildscript {
dependencies {
// ... other dependencies
- classpath 'com.google.gms:google-services:{{ android.google_services }}'
}
}
- Remove the plugin execution via the
/android/app/build.gradle
file:
- apply plugin: 'com.google.gms.google-services'
Using Xcode, open the project's ios/Runner.xcworkspace
file, then delete the GoogleService-Info.plist
file located in the file browser.
Using Xcode, open the project's macos/Runner.xcworkspace
file, then delete the GoogleService-Info.plist
file located in the file browser.
- Remove any Firebase SDK scripts from your
web/index.html
file, for example:
<html>
...
<body>
- <script src="https://www.gstatic.com/firebasejs/{{ web.firebase_cdn }}/firebase-app.js"></script>
- <script src="https://www.gstatic.com/firebasejs/{{ web.firebase_cdn }}/firebase-firestore.js"></script>
<script src="main.dart.js" type="application/javascript"></script>
</body>
</html>
- Remove any
firebase.initializeApp()
logic and configuration from theweb/index.html
file:
<html>
...
<body>
<script>
- var firebaseConfig = { ... };
- firebase.initializeApp(firebaseConfig);
</script>
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
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'
])
}
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'