Description
[REQUIRED] Please fill in the following fields:
- Unity editor version: 2020.3.32f1
- Firebase Unity SDK version: 8.8.0
- Source you installed the SDK: .unitypackage
- Problematic Firebase Component: Firestore
- Other Firebase Components in use: Firestore, Auth
- Additional SDKs you are using: IronSource, mutiiple ad network SDKs
- Platform you are using the Unity editor on: Mac
- Platform you are targeting: Android
- Scripting Runtime: IL2CPP
- Pre-built SDK from the website or open-source from this repo: Pre-built
[REQUIRED] Please describe the question here:
Using a combination of Firebase Authenticate and Firestore, we save player information as Documents to a collection on Firestore. This data is a set of key-value data pairs, indicating player progress and the resulting document hierarchy is flat.
The game uses Firebase 8.8.0 with Unity 2020.3.32f1. The Unity code that saves this data is :-
public override void Save<T>(T saveData, OnSaveProgress onSaveComplete)
{
Logger.Log($"FireStoreCloudSave saving... {id}");
GetDocumentReference().SetAsync(saveData).ContinueWith(t =>
{
if (t.Exception != null)
{
Logger.Log(t.Exception.ToString());
}
else
{
Logger.Log($"save complete {id}");
}
});
onSaveComplete?.Invoke(Type.FIRESTORE);
}
saveData is a class
[System.Serializable]
public class GameSaveData : SerializableDictionary { }
The code works for 90% of users, but we see the following two crashes in Crashyltics to the remaining 8-10% users :-
Crashlog 1:
(multiple libbase.so Missing UUID xxxxxxxx)
8 libil2cpp.so FirestoreCpp.cs ConvertMapToFieldValue
9 libil2cpp.so ConverterBase.cs ConvertToProxyMap
10 libil2cpp.so DocumentReference.cs SetAsync
11 libil2cpp.so GenericMethods5.cpp - Line 40493 FireStoreCloudSave_Save_TisRuntimeObject_m3EFAD2C4096136226A4FF17AE9A907926CB9744E_gshared + 40493
12 libil2cpp.so GenericMethods6.cpp - Line 89 SaveGameManager_Save_TisRuntimeObject_mD14C102D68CE7A760FC8F9AAE2A83E1C545137A8_gshared + 89
Crashlog 2 :
(multiple libbase.so Missing UUID xxxxxxxx)
8 libil2cpp.so FirestoreCpp.cs DocumentReferenceSetAsync
9 libil2cpp.so GenericMethods5.cpp - Line 40493 FireStoreCloudSave_Save_TisRuntimeObject_m3EFAD2C4096136226A4FF17AE9A907926CB9744E_gshared + 40493
10 libil2cpp.so GenericMethods6.cpp - Line 89 SaveGameManager_Save_TisRuntimeObject_mD14C102D68CE7A760FC8F9AAE2A83E1C545137A8_gshared + 89
On checking our logs and Firestore, we see data available for these users.
Am looking to understand what causes these errors in Crashlytics and the behaviour of Firestore when they occur ?
Crashlog 1 : Is this due to an issue converting a non-compliant data type in Firestore ? FieldValue documentation mentions unsupported types can cause a crash. If so, how can we identify the problem elements in Unity ? Why do we see data in FireStore despite these crashes ?
Crashlog 2 : What can cause a crash on SetAsync ? Is this due to the 1 second limit on saving documents ?