Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity Firebase "Unable to load options for default app" error

When I run the app this error pops up:

Unable to load options for default app ([D:/Projects/Unity/‏‏PullApp/Assets/StreamingAssets\google-services-desktop.json, D:/Projects/Unity/‏‏PullApp/Assets/StreamingAssets\google-services.json] are missing or malformed) UnityEngine.Debug:LogError(Object) Firebase.Platform.FirebaseLogger:LogMessage(PlatformLogLevel, String) (at Z:/tmp/tmp.4oHf4jn9P6/firebase/app/client/unity/src/Unity/FirebaseLogger.cs:19) Firebase.FirebaseApp:LogMessage(LogLevel, String) (at Z:/tmp/tmp.n6hJS53AxW/firebase/app/client/unity/proxy/FirebaseApp.cs:90) Firebase.AppUtilPINVOKE:FirebaseApp_CreateInternal__SWIG_0() Firebase.FirebaseApp:CreateInternal() (at Z:/tmp/tmp.n6hJS53AxW/firebase/app/client/unity/proxy/FirebaseApp.cs:976) Firebase.FirebaseApp:m__0() (at Z:/tmp/tmp.n6hJS53AxW/firebase/app/client/unity/proxy/FirebaseApp.cs:144) Firebase.FirebaseApp:CreateAndTrack(CreateDelegate, FirebaseApp) (at Z:/tmp/tmp.n6hJS53AxW/firebase/app/client/unity/proxy/FirebaseApp.cs:537) Firebase.FirebaseApp:Create() (at Z:/tmp/tmp.n6hJS53AxW/firebase/app/client/unity/proxy/FirebaseApp.cs:144) Firebase.FirebaseApp:get_DefaultInstance() (at Z:/tmp/tmp.n6hJS53AxW/firebase/app/client/unity/proxy/FirebaseApp.cs:116) DBManager:InitializeFirebase() (at Assets/Scripts/DBManager.cs:30) DBManager:b__0_0(Task`1) (at Assets/Scripts/DBManager.cs:17) System.Threading._ThreadPoolWaitCallback:PerformWaitCallback()

It already worked perfectly on this project, and I don't know what I did that changed it (I can't use Ctrl+Z cause I've closed the app several times since it happened in trying to fix this..) I've already tried to delete all the assets related to firebase and re-import them, still the same error occurs. Also, When I press the error it self, it leds me the this line in my code:

FirebaseApp app = FirebaseApp.DefaultInstance;

tho it's the default line of firebase it self so..

Please help me. I've tried everything and I'm stuck :/

like image 842
Dor Dahan Avatar asked Mar 21 '26 06:03

Dor Dahan


2 Answers

In my case Special sign in filepath caused this error!

like image 103
M16aV Avatar answered Mar 23 '26 20:03

M16aV


google-services json file should be named as "google-services". Other names like "google-services(1)" will give error.

like image 20
Satyam Avatar answered Mar 23 '26 18:03

Satyam