firebase-unity-sdk icon indicating copy to clipboard operation
firebase-unity-sdk copied to clipboard

[Bug] "Unable to load Firebase app options" when running as standalone executable in a folder which contains non-ASCII characters

Open jiahengnz opened this issue 4 years ago • 6 comments

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2020.3.19f1
  • Firebase Unity SDK version: 8.6.2
  • Source you installed the SDK: .unitypackage
  • Problematic Firebase Component: App
  • Other Firebase Components in use: Auth
  • Additional SDKs you are using: None
  • Platform you are using the Unity editor on: Windows
  • Platform you are targeting: Desktop
  • Scripting Runtime: Mono

[REQUIRED] Please describe the issue here:

When running as a standalone executable, Firebase is unable to create app/load Firebase app options when a non-ASCII character is present in the directory name/path.

Here is a YouTube video demonstrating this bug:

https://youtu.be/6zDzuXBCTB8

This appears similar to firebase/quickstart-unity#1089 firebase/quickstart-unity#1069 firebase/firebase-unity-sdk#427

Steps to reproduce:

To reproduce the issue:

  1. Create new Unity project
  2. Import Firebase Unity SDK
  3. Create a method/function which tries to login with Firebase Auth, and a way to call that method/function.
  4. Build a standalone executable 4a. Assuming the build is in a folder that does not contain any special characters, the login attempt should succeed at this point
  5. Rename the directory where the build is located to something which contains a special character
  6. Attempt to login and the following error will be thrown:
InitializationException:  Firebase app creation failed.
  at Firebase.FirebaseApp.CreateAndTrack (Firebase.FirebaseApp+CreateDelegate createDelegate, Firebase.FirebaseApp existingProxy) [0x000da] in Z:\tmp\tmp.uQUresKAQs\firebase\app\client\unity\proxy\FirebaseApp.cs:597 
  at Firebase.FirebaseApp.Create () [0x00000] in Z:\tmp\tmp.uQUresKAQs\firebase\app\client\unity\proxy\FirebaseApp.cs:124 
  at Firebase.FirebaseApp.get_DefaultInstance () [0x0000b] in Z:\tmp\tmp.uQUresKAQs\firebase\app\client\unity\proxy\FirebaseApp.cs:99 
  at Firebase.Auth.FirebaseAuth.get_DefaultInstance () [0x00000] in Z:\tmp\tmp.iEHLvp1aL4\firebase\auth\client\unity\proxy\FirebaseAuth.cs:295 
  at TestScript.Update () [0x00053] in C:\Users\work\Desktop\FirebaseMinimalTest\Assets\TestScript.cs:31 

(Filename: Z:/tmp/tmp.uQUresKAQs/firebase/app/client/unity/proxy/FirebaseApp.cs Line: 597)

Unable to load Firebase app options ([C:/Users/work/Desktop/FirebaseMinimalTest/Buildé/FirebaseMinimalTest_Data/StreamingAssets\google-services-desktop.json, C:/Users/work/Desktop/FirebaseMinimalTest/Buildé/FirebaseMinimalTest_Data/StreamingAssets\google-services.json] are missing or malformed)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogError (object)
Firebase.Platform.FirebaseLogger:LogMessage (Firebase.Platform.PlatformLogLevel,string) (at Z:/tmp/tmp.cEjnms3lS8/firebase/app/client/unity/src/Unity/FirebaseLogger.cs:95)
Firebase.LogUtil:LogMessage (Firebase.LogLevel,string) (at Z:/tmp/tmp.uQUresKAQs/firebase/app/client/unity/proxy/LogUtil.cs:69)
Firebase.LogUtil:LogMessageFromCallback (Firebase.LogLevel,string) (at Z:/tmp/tmp.uQUresKAQs/firebase/app/client/unity/proxy/LogUtil.cs:77)
Firebase.AppUtil:PollCallbacks () (at Z:/tmp/tmp.uQUresKAQs/firebase/app/client/unity/proxy/AppUtil.cs:32)
Firebase.Platform.FirebaseAppUtils:PollCallbacks () (at Z:/tmp/tmp.uQUresKAQs/firebase/app/client/unity/proxy/FirebaseAppUtils.cs:33)
Firebase.Platform.FirebaseHandler:Update () (at Z:/tmp/tmp.cEjnms3lS8/firebase/app/client/unity/src/Unity/FirebaseHandler.cs:208)
Firebase.Platform.FirebaseMonoBehaviour:Update () (at Z:/tmp/tmp.cEjnms3lS8/firebase/app/client/unity/src/Unity/FirebaseMonoBehaviour.cs:45)

(Filename: Z:/tmp/tmp.uQUresKAQs/firebase/app/client/unity/proxy/LogUtil.cs Line: 69)

jiahengnz avatar Nov 28 '21 19:11 jiahengnz

Hi @jiahengnz,

Thanks for reporting this issue. Could you provide the sample code you used so that we can identify what's causing this behavior? Could you also confirm if the error message also appears in the Unity editor?

paulinon avatar Nov 29 '21 14:11 paulinon

Hi,

The error message does appear in the editor after renaming the project folder to FirebaseMinimalTést.

Source code attached below.

Run in editor/make a build as it is and it will login fine. Change the project name or build folder name to, say, FirebaseMinimalTést, and it will throw the error

https://drive.google.com/file/d/1dC3SZ6FYa4C4oAIo9bp-Sog7FJm-L3Uq/view?usp=sharing

jiahengnz avatar Dec 01 '21 16:12 jiahengnz

Hi @jiahengnz,

I've downloaded the sample project you provided, but I wasn't able to replicate your issue. However, I should point out that I'm using version 2021.2.3f1 of the Unity editor. Could you try using an updated editor and see if the issue persists?

paulinon avatar Dec 01 '21 18:12 paulinon

Hi,

Just tested in 2021.2.4f1, the bug occurs in both the editor and the build. Have you renamed the project folder to one with a character like é? The zip as it is will run with no problems.

Unable to load Firebase app options ([C:/Users/work/Desktop/FirebaseMinimalTést/Assets/StreamingAssets\google-services-desktop.json, C:/Users/work/Desktop/FirebaseMinimalTést/Assets/StreamingAssets\google-services.json] are missing or malformed) UnityEngine.Debug:LogError (object) Firebase.Platform.FirebaseLogger:LogMessage (Firebase.Platform.PlatformLogLevel,string) (at Z:/tmp/tmp.cEjnms3lS8/firebase/app/client/unity/src/Unity/FirebaseLogger.cs:95) Firebase.LogUtil:LogMessage (Firebase.LogLevel,string) (at Z:/tmp/tmp.uQUresKAQs/firebase/app/client/unity/proxy/LogUtil.cs:69) Firebase.LogUtil:LogMessageFromCallback (Firebase.LogLevel,string) (at Z:/tmp/tmp.uQUresKAQs/firebase/app/client/unity/proxy/LogUtil.cs:77) Firebase.AppUtil:PollCallbacks () (at Z:/tmp/tmp.uQUresKAQs/firebase/app/client/unity/proxy/AppUtil.cs:32) Firebase.Platform.FirebaseAppUtils:PollCallbacks () (at Z:/tmp/tmp.uQUresKAQs/firebase/app/client/unity/proxy/FirebaseAppUtils.cs:33) Firebase.Platform.FirebaseHandler:Update () (at Z:/tmp/tmp.cEjnms3lS8/firebase/app/client/unity/src/Unity/FirebaseHandler.cs:208) Firebase.Platform.FirebaseMonoBehaviour:Update () (at Z:/tmp/tmp.cEjnms3lS8/firebase/app/client/unity/src/Unity/FirebaseMonoBehaviour.cs:45)

jiahengnz avatar Dec 01 '21 21:12 jiahengnz

Hi @jiahengnz,

It turns out I didn't encounter this issue at first because I was using a macOS device. I recently tested this on a Windows machine, and I was able to encounter the same error message.

I'll be marking this as a bug for now. Let me discuss this with the team, and I'll get back to you once I have updates.

paulinon avatar Dec 02 '21 16:12 paulinon

Excellent, I look forward to hearing back from you

jiahengnz avatar Dec 02 '21 20:12 jiahengnz

is this issue resolved now? I am still encountering same issue.

yubingxdc avatar Jan 18 '23 01:01 yubingxdc

hey @paulinon any news on this one? We're encountering exactly the same issue as described, using version 11.1.0

robojiannis avatar Jul 04 '23 10:07 robojiannis

This has been fixed in the Firebase C++ SDK,, and the fix will be included in the next release (11.3.0) of the Firebase Unity SDK. Closing this bug, but feel free to reopen if it recurs in the future.

jonsimantov avatar Jul 13 '23 23:07 jonsimantov