Skip to content
Karen Ly edited this page Feb 15, 2021 · 5 revisions

Adding Firebase to Project

  1. Add “Assets/Data” and “Assets/Firebase” into .gitignore if not there yet.
  2. Create a Firebase project, following the given steps on the Firebase console.
  3. Import the SDK setup and configuration files, google-services.json for Android and GoogleService-Info.plist for iOS, into your Unity Assets folder. Create a Data folder under Assets and place the two files there.
  4. Reopen your Unity project to allow changes to execute.
  5. Download Firebase Unity SDK zip file from here Step 4 and unzip the file.
  6. In Unity project, Assets->Import Package->Custom Package. Import any desired Firebase packages. This particular project uses Firebase Storage from dotnet4 folder.
  7. If prompted, enable Analytics for External Dependency Manager.

Troubleshooting/Common Errors

  • If you receive the error "Generation of the Firebase Android resource file google-services.xml from Assets/Data/GoogleService-Info.plist failed," go to your Firebase project and create a Realtime Database. Reimport the google-services.json and GoogleService-Info.plist files by downloading them again from the Firebase console.
  • Make sure your project identifiers for your Firebase project matches your bundle identifiers for iOS and Android on Unity.
  • When pushing to GitHub, if you receive an error about large files and potentially not being able to commit further changes, make sure you have added Firebase to .gitignore. It is also suggested to .gitignore your configuration files if you want others to set up their own Firebase project to host its configuration and data.
Clone this wiki locally