iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📦

Failed to load google-services.json when integrating Crashlytics into Unity

に公開

Environment

OS: Windows
Unity: 2023.2.11f1
Platform: Android

Overview

I attempted to integrate Firebase Crashlytics following the official instructions. However, when running the app on an Android device, the following error occurred during Firebase initialization, preventing it from working correctly.

It seems that google-services.json is not being read properly.

firebase Failed to read Firebase options from the app's resources. Either make sure google-services.json is included in your build or specify options explicitly.

Solution

Although this is an Android issue, it was resolved by installing iOS Build Support for some reason.

I am not entirely sure about the details, but come to think of it, the errors related to iOS DLLs that had been appearing constantly disappeared after installing iOS Build Support. It is possible that the Firebase setup process within the Editor was not proceeding correctly due to those missing dependencies.

For reference, I found the solution in the following comment:

https://github.com/firebase/firebase-unity-sdk/issues/761#issuecomment-1590007435

Discussion