I would like to setup Firebase in Unity 2020.1.14.
I downloaded the GoogleService-Info.plist into my assets folder and set up a project in the Firebase console.
But as soon as I import the FirebaseAnalytics 7.0 package I'm getting this error:
Generation of the Firebase Android resource file google-services.xml from Assets/GoogleService-Info.plist failed.
If you have not included a valid Firebase Android resources in your app it will fail to initialize.
"python" "/Users/joerg/Projekte/UnityTest/FirebaseTest2012042/Assets/Firebase/Editor/generate_xml_from_google_services_json.py" -i "Assets/GoogleService-Info.plist" -l --plist
Could not find key in plist file: [DATABASE_URL]
How do I set the [DATABASE_URL] in GoogleService-Info.plist?
Thanks Joerg
No google-services.json files found in your project so it is not possible to generate Firebase Android resources file google-services.xml. Building without Firebase Android resources (google-services.xml) will result in an app that will fail to initialize.
Replace these files in you Unity project. (these files should be inside of the Assets folder, or if you've created a Data folder, then you can find them there.) In the newly generated files there is a "firebase_url":. Which was missing before. This should now fix this particular error message. Thanks for the detailed instructions.
Some Basic functions of unity like changing scene, changing texts dynamically, etc.. 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.
Click google-services.json. Add the GoogleService-Info.plist file to the project. Navigate to the Assets folder in the Project window. Drag the GoogleService-Info.plist downloaded from the Firebase console into the folder. NOTE: GoogleService-Info.plist can be placed anywhere under the Assets folder.
This was really frustrating. There is no mention on the original setup tutorial about this issue. I'm assuming more people are going to run in to this problem. So here is the solution:
After database is created.
google-services.json
and GoogleService-Info.plist
In the newly generated files there is a "firebase_url":
. Which was missing before. This should now fix this particular error message.
Ok, I found the solution: I just had to setup a database in the Firebase Console and then the url is written to the plist file. This wasn't mentioned in the Google tutorial.
Simple solution, just add those lines:
<key>DATABASE_URL</key>
<string>https://unexisting.fake.database.firebaseio.com</string>
p.s. I would not recommend enabling database service since it's paid. If for some reason, some plugin will attempt to use it in some way, you will be charged. The only reason I am not using those awesome paid services from Google is that they are only POST PAID without ability to set limit (except you wrote some complicated script yourself which will run in real time and will turn off services once you reach certain limit). There are lot of developers stories who woke up with 5-10k bills due to some error in script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With