Firebase SDK Generation of the Firebase Android resource file google-services.xml failed

Hello Everyone.

So, I don’t know if this is the place to post this, but I already posted in the Github page of the project SDK’s and no one answered, so I figured it wouldn’t hurt to ask.

I am trying to do Authentication and Analytics through Firebase SDK’s for Unity. I followed all the footsteps listed in their documentation and got it to work at some level.

The Auth is working. I can register new users, and it is giving me the correct errorCodes (Exceptions).
Here it’s where it gets weird. Some Basic functions of unity like changing scene, changing texts dynamically, etc…

This is the error I keep getting:

Generation of the Firebase Android resource file google-services.xml from Assets/Firebase/GoogleService-Info.plist failed.

If you have not included a valid Firebase Android resources in your app it will fail to initialize.

“python” “/Users/xxxxx/Documents/ProgrammingCloud/Unity/yyyyy/Assets/Firebase/Editor/generate_xml_from_google_services_json.py” -i “Assets/Firebase/GoogleService-Info.plist” -l --plist

Could not find key in plist file: [DATABASE_URL]

You can start to diagnose this issue by executing ““python” “/Users/xxxxx/Documents/ProgrammingCloud/Unity/yyyyy/Assets/Firebase/Editor/generate_xml_from_google_services_json.py” -i “Assets/Firebase/GoogleService-Info.plist” -l --plist” from the command line.

UnityEngine.Debug:LogError(Object)

Firebase.Editor.GenerateXmlFromGoogleServicesJson:RunResourceGenerator(IEnumerable`1, String, Boolean) (at Z:/tmp/tmp.DPw5MV1I7c/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:542)

Firebase.Editor.GenerateXmlFromGoogleServicesJson:ReadBundleIds(String) (at Z:/tmp/tmp.DPw5MV1I7c/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:407)

Firebase.Editor.GenerateXmlFromGoogleServicesJson:UpdateConfigFileDirectory() (at Z:/tmp/tmp.DPw5MV1I7c/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:295)

Firebase.Editor.GenerateXmlFromGoogleServicesJson:CheckConfiguration() (at Z:/tmp/tmp.DPw5MV1I7c/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:246)

Firebase.Editor.GenerateXmlFromGoogleServicesJson:m__1() (at Z:/tmp/tmp.DPw5MV1I7c/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:103)

Google.c__AnonStorey0:<>m__0() (at Z:/tmp/tmp.Ujmedx6O9O/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/EditorInitializer.cs:60)

Google.RunOnMainThread:ExecutePollingJobs() (at Z:/tmp/tmp.Ujmedx6O9O/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:409)

Google.RunOnMainThread:m__1() (at Z:/tmp/tmp.Ujmedx6O9O/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:541)

Google.RunOnMainThread:RunAction(Action) (at Z:/tmp/tmp.Ujmedx6O9O/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)

Google.RunOnMainThread:ExecuteAllUnnested(Boolean) (at Z:/tmp/tmp.Ujmedx6O9O/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530)

Google.RunOnMainThread:ExecuteAll() (at Z:/tmp/tmp.Ujmedx6O9O/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:512)

UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:332)

This is the post in the GitHub page:

I would appreciate some help. Getting pretty desperate, I’ve been on this all day long.

2 Likes

I’m getting the same error. Some searching online says that if you create a Realtime Database (under the Build section) in your Firebase console that it can work. But this is not part of any of the Firebase Unity tutorials.

Friends who are developing on other platforms who are using Crashlytics + Google Analytics services as part of Firebase do NOT have to create a Realtime Database.

5 Likes

So I created a Realtime Database, set it to have no read/write privileges (it’s one of the default options), regenerated the google-services.json file, and… it worked.

Sounds like a bug, but at least this is a workaround. Since the Realtime Database can’t be written to it should not bill you anything, but it’s pretty silly.

5 Likes

You should be setting up the project on Firebase as a Unity project which will include both the files required for Android and iOS. Do you have both files in your Assets folder in your project? These files are also used for PC builds, which I think it uses the Android one if you’re doing PC.

Also, make sure your Firebase packages are up to date. 7.0.1 is the latest version I’m showing. Any of the packages you use will all need to be on the same version.

Great, that fixed my problem too. Thanks!

2 Likes

@[Endahs]( Firebase SDK Generation of the Firebase Android resource file google-services.xml failed members/endahs.688802/)

Thanks for linking my thread with the fix in the GitHub regarding this subject. I had forgotten to do so!

Workaround for this problem (without creating a database):

2 Likes

Worked for me, thanks for sharing! :slight_smile:

As well as for me.