Hey guys. I’m having a little trouble. Maybe this is simple but i cant get firebase to work with my version of unity.
I get “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.” on the phones logcat
Google-services.json is in the root directory. I’ve searched google for HOURS looking for a solution and nothing anyone else has said to try works. I’ve also made several fresh projects and followed firebase tutorials from the beginning very carefully. I’m not sure what else to do here
did you manage to figure this out? im hitting the same issue. Logcat says Missing google_app_id. Firebase Analytics disabled. using unity 2020 as well.
I have the google-services.json in there, doing some research. it seems unity is not copying across the google-services.xml on build.
Been working on it all week without being able to resolve the issue…
Hey guys, after searching high and low, went on google forums, i found that you can add a line to the custom build gradle
if you go to the following page 将 Firebase 添加到您的 Unity 项目 | Firebase for Unity and scroll down to ‘Known Issues’
there is a section which states Missing Firebase Android config file in Unity 2020.
and the temporary work around to fix it is there.
It is working for me now
I also had this issue in Unity 2022.3.16f1 with firebase analytics 11.81. The fix was like razgames1 said. His link seems to be broken though so I’ll relink it. The reason seems to be stated by tsuharesu here. TLDR the fix is to create the directory Assets/Plugins/Android/Firebase.androidlib/res/values. Then in res/values create a file named “google-services.xml” with the following text:
Why does this work? And why did I have to spend a week researching to get to this answer? All the instructions I followed on Unity, Firebase, and Google sites, and this hack works!