-
Notifications
You must be signed in to change notification settings - Fork 424
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
Firebase Database 6.16.0 crashes Unity Editor on Install and on Play (with easy fix) #807
Comments
Hi @ogzavc, it seems you have the same error as I had. |
Hi! How to fix this error on Windows? |
Hi, I have this exact same error and for the life of me have not been able to resolve it. I have tried earlier versions of both Unity and the Firebase database, also using the dotnet3 sdks (with little hope) however still no luck. I took at look at trying to implement your solution above but cannot seem to get it working for me on Windows. If you go to Assets>External Dependency Manager>Android Resolver>Settings and then scroll to the bottom, it does indicate that 'Custom Gradle Properties Template' should be checked under Publishing Settings in the Player tab on versions of Unity > 2019.3 however this did nothing for my issue. |
Hi, actually i'm working on windows pc, so i think i dont have to give permission. But i've tried to run unity as administrator and i've changed folder name to lowercase and both solutions did not help to me. |
Any solution guys? |
@nagibator96 I just updated the description. |
Hey @chkuang-g , first of all thanks for fixing the gc alloc issue. Can you comment on this issue? Seems I'm not the only one having problem with Firebase Database 6.16.0 |
@snorrsi @nagibator96 |
Cheers for the help I retried the solution this morning and got it working as well. |
Hi folks, I can reproduce this issue locally. As @snorrsi mentioned, this issue is in C++ code. https://github.com/firebase/firebase-cpp-sdk/blob/master/database/src/desktop/util_desktop_macos.mm#L33
I'm currently working on a patch for this and should be included in the next patch release. Shawn |
Solution for Windows works for me. Thanks! :D |
That is worked for Windows for me. Unity 2019.4.0f1 and firebase_unity_sdk_6.16.0 . Thanks. |
Confirmed the folder fix worked for me. Thanks @snorrsi |
Success! napbla's solution worked for me, I created the file and set its name to the bundle identifier found in Player Settings. |
Hi. I'm getting the exact same error. The database reference isn't working in the unity editor but it is working fine in the android build. Any help related to this will be much appreciated |
Thanks a lot @snorrsi! |
Hi @PhixDev and @hussaynnasir I haven´t had that issue myself. |
Hello The folder trick worked for a little while, but now I get the same issue again, I removed Firebase entirely and installed it through packages (Not UPM) and the same problem repeated itself. I returned to UPM versions and tried a force resolve, this triggers a Java warning and a "Java runtime missing, please install" error, I am using the built in OpenJDK (Tried uncheck and browse trick) Also JAVA_HOME points at the unity OpenJDK folder. In my editor logs I see the "Could not initialize persistence: Unable to find app data directory" error and a great many "Fallback handler could not load library" for FirebaseCppApp-6_16_0.bundle and variants. I have check the security settings and no Firebase packages are listed, although they all were blocked with manual installs and had to be allowed before. the final error in the log is: Got a SIGSEGV while executing native code. This usually indicates [Unity Package Manager (Upm)] Running MacOS Catalina 10.15.5 and Unity 2019.3.4f1 |
hi @steve6t6 , have you been switching platforms in Unity ? I ask because the bundle_id / package_name is not always the same for all operating systems. The other fallback errors happen all the time for me, not sure about the cause there maybe @chkuang-g can explain those. |
Hi Snorrsi I had checked the package name initially, but your message forced me to look again, then to remember our dev builds target different google-service files where the name was Camel Cased. So thanks to you my app no longer immediately crashes. Force resolve still won't work and there are 15 shiny new errors to dig into, but it's running. Hopefully @chkuang-g can shed light on the bizzar Force resolve Java fail. Thanks again @snorrsi |
If you want the client to do it on Mac |
I face the same problem. I am using Windows. I created folder in "Local" folder with the name identical to bundle name written in google-services.json. I tried combine Upper/Lower cases in names. I still have the same error. |
Created the folder with the same name as bundle ID on windows and it solved my problem! |
Thank you for your patience. We just released 6.16.1 which should fix issues with creating recursive directories for persistent storage in Realtime Database. Please let us know if you are still seeing issues with it. |
@rexxmagtar But why did you dislike my comment? You could ask for help and would do the needful gladly. |
Thanks for the update, also would like to know why it shows FirebaseApp.DefaultInstance.SetEditorDatabaseUrl as obsolete and deprecated? |
@bhupiister they have deprecated that function but the documentation has not been updated. Maybe @chkuang-g can push that. You should use AppOptions instead .. check out AppOptions and how to use it FirebaseApp.Create(AppOptions options) |
All of the service account APIs will be removed in the next release, since many of them were temporary solution before we finished desktop implementation. As @snorrsi, if you like to use a different database in editor, you should be able use FirebaseApp.Create(AppOptions options). If you need to manage your Firebase project as administrator, by using APIs like Shawn |
[REQUIRED] Please fill in the following fields:
[REQUIRED] Please describe the issue here:
After installing Firebase Database version 6.16.0 using Unity Package Manager pressing Play in project which uses Firebase Database crashes the Unity Editor.
The Editor also did crash when installing Firebase Database through UPM
In the Unity Editor.Log I can see:
ERROR: Could not initialize persistence: Unable to find app data directory.
This seems to be causing the crash.
After looking at the Firebase Database C++ code I found out what was causing this error.
It's quite obvious as the error message can be found in database/src/desktop/core/repo.cc
By looking at that file I saw the cause was relating to GetAppDataPath
On Mac GetAppDataPath seems to be finding the Application Support directory and appending the package_name to that if that folder exists.
It seems to be using package_name for the folder which is according to the xml converter created from the bundle_id.
In my case the bundle_id was: Is.Company.App
Which lead me to the conclusion that Firebase Database was looking for the folder path
~/Library/Application Support/Is.Company.App
That folder did not exists which explained the error.
I therefore created it and after that the Unity Editor ran without crashing and I saw data being created in a subfolder of the folder I just created and no error in Unity logs.
Steps to reproduce:
Install Firebase Database 6.16.0 through Unity Package Manager.
Firebase Database might fail on install.
Create scene and c# files which starts Firebase App.
Press Play and see if crash occurs.
If the Unity Editor crashes then open Unity Editor.Log and look for:
ERROR: Could not initialize persistence: Unable to find app data directory.
To fix for MacOS
For Firebase App with bundle id (package_name): Is.Company.App
Just create the folder: ~/Library/Application Support/Is.Company.App
To fix for Windows
For Firebase App with bundle id (package_name): Is.Company.App
Just create the folder: C:\Users[username]\AppData\Local\Is.Company.App
The folder is in path (see set) such as fx.:
LOCALAPPDATA=C:\Users[username]\AppData\Local
Note
You might need to use upper or lowercase package_name. Just try according to your bundle_id or package_name stated in google-services.json
I did not help to downgrade to 6.15.2 and then install 6.16.0 again.
The text was updated successfully, but these errors were encountered: