You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additional SDKs you are using: Facebook, Apple Sign In, Google Sign In, Unity Ads, Unity Purchasing
Platform you are using the Unity editor on: Mac M1
Platform you are targeting: iOS
Scripting Runtime: IL2CPP
[REQUIRED] Please describe the issue here:
The app crashes on iOS during my ListenServerVersion() function call.
The function is listening for a Firestore snapshot.
This has only started happening as of 8.5.0. It was working fine in previous versions.
Steps to reproduce:
Try to listen to a document snapshot during the firebase startup dependency check.
Relevant Code:
This is the startup code. The problematic function is called near the end of the startup sequence.
void StartFirebase()
{
//Check Dependencies
Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>
{
var dependencyStatus = task.Result;
if (dependencyStatus == Firebase.DependencyStatus.Available)
{
//Dynamic Links
DynamicLinks.DynamicLinkReceived += OnDynamicLink;
//App Reference
appRef = Firebase.FirebaseApp.DefaultInstance;
//Authentication Reference
authRef = Firebase.Auth.FirebaseAuth.DefaultInstance;
//Firestore Reference
firestoreRef = FirebaseFirestore.DefaultInstance;
//Realtime Database Reference
databaseRef = FirebaseDatabase.DefaultInstance;
//Storage Reference
storageRef = FirebaseStorage.DefaultInstance.RootReference;
//Function Reference
functionRef = FirebaseFunctions.DefaultInstance;
//Get Remote Config Reference
remoteConfigRef = Firebase.RemoteConfig.FirebaseRemoteConfig.DefaultInstance;
//Set Initialized
IsFirebaseInitialized = true;
//Setup Remote Config
SetupRemoteConfig();
//Listen for Server Version
ListenServerVersion();
Debug.Log("Firebase Initialized!");
}
else
{
UnityEngine.Debug.LogError(System.String.Format(
"Could not resolve all Firebase dependencies: {0}", dependencyStatus));
// Firebase Unity SDK is not safe to use here.
}
});
}
This is the function in question:
///Listen Server Version
void ListenServerVersion()
{
DocumentReference docRef = firestoreRef.Collection("server").Document("info");
versionListener = docRef.Listen(snapshot =>
{
//Get Snapshot
Dictionary<string, object> dict = snapshot.ToDictionary();
//Check Server Version
int version = int.Parse(dict["version"].ToString());
//Update State
print("Check Server Version: " + version + " == " + SaveManager.ServerVersion);
if (version == SaveManager.ServerVersion)
{
//Continue
print("Server Version Verified!");
IsFirebaseVerified = true;
HideInfo();
}
else
{
print("Server Version Mismatch!");
IsFirebaseVerified = false;
ShowInfo(CuriousLocalization.GetLocalizedString("error-app-maintenance") + "\n" + CuriousLocalization.GetLocalizedString("error-app-update"), 0.5f);
SaveManager.SplashSeen = false;
LoadController.instance.LoadScene("Login");
}
});
}
This is the log from xCode:
2021-11-03 11:42:13.041743-0600 DoodleParty[347:11616] WF: _WebFilterIsActive returning: NO
Unexpected exception thrown by DocumentSnapshotsHandler() when invoked by P/Invoke: System.NullReferenceException: Object reference not set to an instance of an object.
at FirebaseManager.<ListenServerVersion>b__262_0 (Firebase.Firestore.DocumentSnapshot snapshot) [0x00000] in <00000000000000000000000000000000>:0
at System.Action`1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0
at Firebase.Firestore.DocumentReference+<Listen>c__AnonStorey0+<Listen>c__AnonStorey1.<>m__0 () [0x00000] in <00000000000000000000000000000000>:0
at System.Func`1[TResult].Invoke () [0x00000] in <00000000000000000000000000000000>:0
at Firebase.Dispatcher.Run[TResult] (System.Func`1[TResult] callback) [0x00000] in <00000000000000000000000000000000>:0
at Firebase.Platform.FirebaseHandler.RunOnMainThread[TResult] (System.Func`1[TResult] f) [0x00000] in <00000000000000000000000000000000>:0
at Firebase.Firestore.DocumentReference+<Listen>c__AnonStorey0.<>m__0 (Firebase.Firestore.DocumentSnapshotProxy snapshotProxy, Firebase.Firestore.FirestoreError errorCode, System.String errorMessage) [0x00000] in <00000000000000000000000000000000>:0
at System.Action`3[T1,T2,T3].Invoke (T1 arg1, T2 arg2, T3 arg3) [0x00000] in <00000000000000000000000000000000>:0
at Firebase.Firestore.DocumentReference.DocumentSnapshotsHandler (System.Int32 callbackId, System.IntPtr snapshotPtr, Firebase.Firestore.FirestoreError errorCode, System.String errorMessage) [0x00000] in <00000000000000000000000000000000>:0
at Firebase.AppUtilPINVOKE.Firebase_App_PollCallbacks () [0x00000] in <00000000000000000000000000000000>:0
at Firebase.AppUtil.PollCallbacks () [0x00000] in <00000000000000000000000000000000>:0
at Firebase.Platform.FirebaseAppUtils.PollCallbacks () [0x00000] in <00000000000000000000000000000000>:0
at Firebase.Platform.FirebaseHandler.Update () [0x00000] in <00000000000000000000000000000000>:0
at Firebase.Platform.FirebaseMonoBehaviour.Update () [0x00000] in <00000000000000000000000000000000>:0
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogError(Object)
Firebase.Platform.FirebaseLogger:LogMessage(PlatformLogLevel, String)
Firebase.LogUtil:LogMessage(LogLevel, String)
Firebase.Firestore.Internal.Util:OnPInvokeManagedException(Exception, String)
Firebase.Firestore.DocumentReference:DocumentSnapshotsHandler(Int32, IntPtr, FirestoreError, String)
Firebase.AppUtilPINVOKE:Firebase_App_PollCallbacks()
Firebase.AppUtil:PollCallbacks()
Firebase.Platform.FirebaseAppUtils:PollCallbacks()
Firebase.Platform.FirebaseHandler:Update()
Firebase.Platform.FirebaseMonoBehaviour:Update()
The text was updated successfully, but these errors were encountered:
Unfortunately, this is a known issue that snuck into the 8.5.0 release. We have a fix for it in the next release whose ETA is roughly 2 weeks from now. The only workaround is to downgrade the Unity SDK. Please see this duplicate issue for more details: #1171
[REQUIRED] Please fill in the following fields:
[REQUIRED] Please describe the issue here:
The app crashes on iOS during my ListenServerVersion() function call.
The function is listening for a Firestore snapshot.
This has only started happening as of 8.5.0. It was working fine in previous versions.
Steps to reproduce:
Try to listen to a document snapshot during the firebase startup dependency check.
Relevant Code:
This is the startup code. The problematic function is called near the end of the startup sequence.
This is the function in question:
This is the log from xCode:
The text was updated successfully, but these errors were encountered: