New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to read Firebase options from the app's resources. #596
Comments
This issue does not seem to follow the issue template. Make sure you provide all the required information. |
Hi @tkminh, If this is a bug, I will need you to to try to reproduce this in one of the Unity Quick Start's if possible so we can get a good starting point to work from. Additionally, upgrading to the latest plugin (version 6.11.0) might help as well. In particular, I see a potentially related fix in 6.8.0. Since you do see a Finally, since you do list Auth as one of the SDKs you're using, did you enable the authentication providers you plan on using? You can follow the instructions in the video on this page. If any of those above steps work, let us know! Otherwise, repro steps in the quickstart will help us a ton! Thanks, |
Hi @patm1987 , I solved it by adding below in the mainTemplate.gradle
Many thanks. |
What happen or what changed that we need to add that |
I have the same problem, even adding sourceSets and the google-services.json file, it didn't work, I use UNITY 2019.3.6f1, firebase sdk 6.12.0, windows 10, to create android. I've tested it on other versions of unity and the same error happens. "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." I followed the video tutorial https://www.youtube.com/watch?v=A6du3DUTIPI&feature=youtu.be but it doesn't work. Any other solution? sorry for the english ... I don't know much ... :)After testing a little more, I realized that Unity was not generating the googleservices xml. Searching I found a site that converts google-services.json to XML values. I created an xml file, and saved it to the folder, Assets \ Plugins \ Android \ Firebase \ res \ values I managed to generate the apk and run it without a problem after this change, but there is still an error when I open it I believe that the error is in the files generate_xml_from_google_services_json exe and py, I'm not sure about that or it could be a Unity error. Hope this helps. |
Because the google file is missing when we build to APK, you can try to debug ABK Profiler to see it. So we just need to find a way to add in our APK. |
Please try to add the script in the mainTemplate.gradle // Android Resolver Exclusions End
}REPOSITORIES****SOURCE_BUILD_SETUP |
@tkminh I see, so the point is, we must do everything to add But I wonder why we never need to do that and unity will always build correctly. it seem this 2020 change was affect too many things |
I added the script but it doesn't work for me. |
As I said before, the problem is in the generate_xml_from_google_services_json exe and py files. I made a new project, installed firebase sdk 6.13.0. I put google-services.json in the Assets folder. I created the apk and ran it, and it didn't work. I downloaded another version of sdk 6.8.0 and replaced only those files, without changing maintemplate or any other file. I created the apk and ran it ... it worked on the first try. :) And when opening the Firebase menu in unity, no error appears. I will continue my project this way because I already lost more than a week with this error. unity 2019.3.7f1 + sdk 6.13.0 + with sdk files 6.8.0 = :) Thank you all for your help. |
Please fill in the following fields:
Unity editor version: 2019.3.06f
Firebase Unity SDK version: 6.6.0
Firebase plugins in use (Auth, Database, etc.):https://assetstore.unity.com/packages/tools/network/cross-platform-leaderboard-151816?_ga=2.216116694.174958842.1582891597-1598787340.1576925179
Additional SDKs you are using (Facebook, AdMob, etc.):
Platform you are using the Unity editor on (Mac, Windows, or Linux): Windows 8.1
Platform you are targeting (iOS, Android, and/or desktop): Android
Scripting Runtime (Mono, and/or IL2CPP): Mono
Please describe the issue here:
I'm working on unity project that will post SCORE data to Firebase realtime database (https://assetstore.unity.com/packages/tools/network/cross-platform-leaderboard-151816), and it works when I test on UnityEditor, but not on real mobile android device. :(
Here is the logcat:
02-23 11:34:41.889 13194-13271/com.devzuky.dumpy E/Unity: 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.
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogError(Object)
Firebase.Platform.FirebaseLogger:LogMessage(PlatformLogLevel, String) (at Z:\tmp\tmp.YjzkX82xZ8\firebase\app\client\unity\src\Unity\FirebaseLogger.cs:95)
Firebase.LogUtil:LogMessage(LogLevel, String) (at Z:\tmp\tmp.BahqeQHBdV\firebase\app\client\unity\proxy\LogUtil.cs:68)
Firebase.LogUtil:LogMessageFromCallback(LogLevel, String) (at Z:\tmp\tmp.BahqeQHBdV\firebase\app\client\unity\proxy\LogUtil.cs:76)
Running on desktop I found Assets\StreamingAssets\google-services-desktop.json -> and if i remove this file, and try to run, it will show the same errors as above.
So I think the android build didn't have the file google-services.json ? How can I added to the build and which location ?
The text was updated successfully, but these errors were encountered: