Skip to content
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

[Bug] Windows user containing non-ANSI characters (e.g. ä) causes Unity Editor crash in Firestore #351

Open
Karottenrambo opened this issue May 19, 2022 · 15 comments

Comments

@Karottenrambo
Copy link

@Karottenrambo Karottenrambo commented May 19, 2022

  • Unity editor version: 2021.3.1f1
  • Firebase Unity SDK version: 8.10.1
  • Source you installed the SDK: unitypackage
  • Problematic Firebase Component: Firestore
  • Other Firebase Components in use: Analytics
  • Platform you are using the Unity editor on: Windows
  • Platform you are targeting: Android, and desktop editor
  • Scripting Runtime: IL2CPP

[REQUIRED] Please describe the issue here:

Accessing the Firestore DB constantly crashes/closes the Unity editor without a freeze or a crashlog.
It does not matter if I get a DocumentReference, or try to read or write data.
Running the same code on an actual android device works.

Steps to reproduce:

Followed the basic Add Firebase to your Unity Game Firecast:

https://www.youtube.com/watch?v=b5h1bVGhuRk&t=283s

I already tried creating an separate Firestore Instance like so:
FirebaseFirestore db = FirebaseFirestore.GetInstance(Firebase.FirebaseApp.Create());

working with the default instance does not work either.

The issue looks similar to this, but I already tried the suggested solutions and it should be fixed in the new SDK version anyways:
firebase/quickstart-unity#638

Unity created the "google-services-desktop" config file, but it's identical to the original "google-services" file, should that be the case?

@ehsannas
Copy link

@ehsannas ehsannas commented May 19, 2022

Thanks for reporting @Karottenrambo . Would you be able to provide the Unity Editor logs located at %LOCALAPPDATA%\Unity\Editor\Editor.log?

@ehsannas ehsannas self-assigned this May 19, 2022
@paulinon paulinon added the needs-info label May 19, 2022
@Karottenrambo
Copy link
Author

@Karottenrambo Karottenrambo commented May 20, 2022

Sure, but I could not find anything suspicious :/

Editor.log

one thing that I did that was not according to the tutorial was, removing Unity.Compat.dll and Unity.Tasks.dll from the folder Parse/Plugins. With them I got an "Type Task<> exists in both Unity.Tasks and mscorelib" error.

@google-oss-bot google-oss-bot added needs-attention and removed needs-info labels May 20, 2022
@dconeybe
Copy link
Contributor

@dconeybe dconeybe commented May 20, 2022

Make sure that you are importing the Firebase unitypackage file(s) from the dotnet4 folder. It sounds like you incorrectly imported the unitypackage file(s) from the dotnet3 folder, which contain an implementation of Task that is not required when using newer versions of the Unity Editor (like you are: 2021.3.1f1).

@Karottenrambo
Copy link
Author

@Karottenrambo Karottenrambo commented May 20, 2022

I imported the package from the dotnet4 Folder. Delteted the 2 DLLs from the Plugins rootfolder and kept the ones from dotnet45
dotnet4

@dconeybe
Copy link
Contributor

@dconeybe dconeybe commented May 20, 2022

You should not have to manually delete Unity.Compat.dll or Unity.Tasks.dll. If you do, then something is going wrong.

Could you try creating a brand new, minimal project that uses Firestore to see if you still get this crash with that new project? If you are able to reproduce, could you post your project in a GitHub repository so that we can observe the crash for ourselves and investigate?

@paulinon paulinon added needs-info and removed needs-attention labels May 24, 2022
@Karottenrambo
Copy link
Author

@Karottenrambo Karottenrambo commented May 24, 2022

I reimported the package and commented out the Code that used "Task" so I could build without the Build error.
So I have all DLLs in place but I still have the same issue.

I created a minimal version:
https://github.com/Karottenrambo/FirebaseCrashTest

But there I get the same issue :/

I guess it might be related to my machine, but how to debug without any kind of logs?

@google-oss-bot google-oss-bot added needs-attention and removed needs-info labels May 24, 2022
@dconeybe
Copy link
Contributor

@dconeybe dconeybe commented May 24, 2022

That project still looks like it had previously incorrectly imported the unitypackage files from the dotnet3 folder.

Please try the following:

  1. Download the latest Firebase Unity SDK from https://firebase.google.com/download/unity (at the moment the latest version is 9.0.0).
  2. In the Unity Editor, go to Assets -> Import Package -> Custom Package.
  3. Select dotnet4\FirebaseFirestore.unitypackage; accept any prompts that it displays.
  4. Repeat the previous two steps for FirebaseAnalytics.unitypackage.
  5. If prompted to delete "obsolete" files, accept that suggestion.

This should get rid of the previously-imported dotnet3 files. See if it still crashes after that.

@Karottenrambo
Copy link
Author

@Karottenrambo Karottenrambo commented May 25, 2022

Unfortunately I still experience the same issue, tried updating both, my original project and the minimal build.
Also tried completely removing the Firebase 8.10.1 SDK and reimporting the 9.0.0 version.

I updated the repository

where do you see the incorrectly imported files from dotnet3?

I really hope we can find a solution for this, on paper Firestore would fit my game much better than playfab...

@dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Jun 4, 2022

Hi @Karottenrambo. Unfortunately, I'm not able to assist further in this investigation. The only thing I can recommend is to try creating a brand new Unity project, import the Firestore unitypackage asset, and try and use Firestore. If that works for you then there is possibly something corrupted in your unity project. If that doesn't work for you, then there will be a much smaller reproducible scenario to investigate.

@dconeybe dconeybe added needs-info and removed needs-attention labels Jun 4, 2022
@Karottenrambo
Copy link
Author

@Karottenrambo Karottenrambo commented Jun 4, 2022

hey @dconeybe

https://github.com/Karottenrambo/FirebaseCrashTest

is a brand new unity project, as you suggested, on my Windows PC it still has the same crashing behavior as on my original Project.

However, meanwhile, I tried checking out the project on my Mac, there accessing the database works without any issues inside the unity Editor.

So it seems indeed connected to my windows PC.

Might there be any issues with accessing the local path that firststore uses for the offline database support?
Or any other ideas to gather more information, the crashing without any kind of logs or pointer where to look for is really the biggest problem...

@google-oss-bot google-oss-bot added needs-attention and removed needs-info labels Jun 4, 2022
@dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Jun 6, 2022

I'm not able to reproduce the crash with your project, even on Windows.

This may be a lot to ask, but would you be able to record a screen capture video of you creating a new project, importing the Firebase unitypackage files, creating a csharp script that uses the Firestore APIs, then crashing? I'm now sure how else to proceed in the absence of logs and reproducibility.

@Karottenrambo
Copy link
Author

@Karottenrambo Karottenrambo commented Jun 7, 2022

I fear that you won't see a lot of useful info in there, but if it helps:

https://www.youtube.com/watch?v=blhs_G9yQgA

@dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Jun 7, 2022

That video was actually incredibly helpful! I noticed something subtle. I believe you are experiencing firebase/firebase-cpp-sdk#728. Basically, if the path to your %USERPROFILE% folder contains non-ANSI characters (e.g. ä) then this causes a crash on Windows. If you're able, could you try creating a user with only plain ANSI characters and try the same steps when logging in as that user?

@Karottenrambo
Copy link
Author

@Karottenrambo Karottenrambo commented Jun 10, 2022

This really was the issue, thanks!

But I really hope that this gets fixed in the future, outside of the anglo American language are many names with special characters, all those users are affected by this bug.

There is no easy workaround for this, renaming the user folder, even with changing the registry, breaks other software, and constantly switching user accounts is really annoying.

Is there a way to manually set the path?

@dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Jun 13, 2022

I'm glad we've found the root cause and a workaround, albeit an annoying workaround.

I'm going to transfer this issue to https://github.com/firebase/firebase-unity-sdk so that we can keep track of it and hopefully fix it in the future. I cannot provide any timeline for the fix, but it will likely be a while due to other priorities.

@dconeybe dconeybe added type: bug and removed type: question needs-attention labels Jun 13, 2022
@dconeybe dconeybe assigned dconeybe and unassigned ehsannas Jun 13, 2022
@dconeybe dconeybe transferred this issue from firebase/quickstart-unity Jun 13, 2022
@dconeybe dconeybe changed the title [Bug] Accessing Firestore crashes the Editor, on Android it works [Bug] Windows user containing non-ANSI characters (e.g. ä) causes Unity Editor crash in Firestore Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants