Closed ak1320 closed 3 months ago
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Hey @ak1320, thanks for reaching out. CheckAndFixDependenciesAsync
runs asynchronously so you're likely logging events before the check completes. You should log your events only after the dependency check completes.
try
{
FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
{
FirebaseApp app = FirebaseApp.DefaultInstance;
// move your log events here
FirebaseApp.LogLevel = LogLevel.Debug;
Parameter[] parameters = { new Parameter("Player", ZPlayerPrefs.GetString("username")) };
FirebaseAnalytics.LogEvent("opened_mall", parameters);
});
}
catch(Exception e)
{
Debug.Log(e);
}
That said, I believe this resolves your issue. I'll go ahead and close this thread. Thanks!
Unfortunately, this code attempt did not work either.
@argzdev issue not solved yet, please open this issue again.
I noticed you're using ContinueWith
. The check has to be done on the main thread. You need to use ContinueWithOnMainThread
.
e.g.
FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task => {
....
});
You may also use our Firebase Unity quickstart for references.
This will likely resolve your issue. I'll go ahead and close this thread. Thanks!
Description
I think I installed Firebase SDK without any problems. Google-services.json is in the Asset folder. When I want to use a "LogEvent" in the game, I get this error without any details.
Autoconnected Player "Autoconnected Player" System.ApplicationException: internal::IsInitialized() at Firebase.Analytics.FirebaseAnalytics.LogEvent (System.String name, Firebase.Analytics.Parameter[] parameters) [0x00000] in <00000000000000000000000000000000>:0 at PUS.Start () [0x00000] in <00000000000000000000000000000000>:0
The start function is as follows:
Reproducing the issue
No response
Firebase Unity SDK Version
12.2.0
Unity editor version
2022.3.40f1
Installation Method
.unitypackage
Problematic Firebase Component(s)
All
Other Firebase Component(s) in use
Analytics
Additional SDKs you are using
No response
Targeted Platform(s)
Android
Unity editor platform
Windows
Scripting Runtime
IL2CPP
Release Distribution Type
Pre-built SDK from https://firebase.google.com/download/unity
Relevant Log Output
No response
If using CocoaPods for Apple platforms, the project's Podfile.lock
Expand
Podfile.lock
snippet```yml 👀 Replace this line with the contents of your Podfile.lock! ```