Description
Description
I am getting the error in the title in my unity project.
This unity project pulls data from my firestore database on start. From March until maybe mid-May, everything has worked perfectly. Then suddenly, I was getting this error on my editor. This error does not come up on my colleague's machines who are working on the same repo/branch at times.
I have tried reinstalling Unity, deleting library folder and recompiling, deleting firebase modules and reimporting. Same error.
I can temporarily fix the issue by changing the settings on the dll file (FirebaseCppApp-12_6_0) in x86_64 folder. If I turn OFF 'Editor' on 'Include Platforms', somehow it starts working. This is temporary because if I close and open the project then this 'fix' does not continue working.
Colleagues on the exact same branch do not have the issue. I have not touched any firebase setting when it was originally imported. All I have done is write code to access the database and it has worked fine until now.
Reproducing the issue
May be difficult to reproduce since this has happened suddenly and not on my colleague's machines.
Try:
- Import SDK into new project on same editor (only using Firestore package)
- do:
void Start()
{
// Initialize Firestore
db = FirebaseFirestore.DefaultInstance;
}
- See if error occurs
Firebase Unity SDK Version
12.6.0
Unity editor version
6000.0.33f1
Installation Method
.unitypackage
Problematic Firebase Component(s)
Firestore
Other Firebase Component(s) in use
No response
Additional SDKs you are using
None.
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
DllNotFoundException: FirebaseCppApp-12_6_0 assembly:<unknown assembly> type:<unknown type> member:(null)
Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () (at /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/linux_unity/app/swig/Firebase.App_fixed.cs:3958)
Rethrow as TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception.
Firebase.AppUtilPINVOKE..cctor () (at /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/linux_unity/app/swig/Firebase.App_fixed.cs:3978)
Rethrow as TypeInitializationException: The type initializer for 'Firebase.AppUtilPINVOKE' threw an exception.
Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) (at /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/linux_unity/app/swig/Firebase.App_fixed.cs:4688)
Firebase.LogUtil..ctor () (at /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/app/src/LogUtil.cs:81)
Firebase.LogUtil..cctor () (at /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/app/src/LogUtil.cs:37)
Rethrow as TypeInitializationException: The type initializer for 'Firebase.LogUtil' threw an exception.
Firebase.FirebaseApp..cctor () (at /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/linux_unity/app/swig/Firebase.App_fixed.cs:1924)
Rethrow as TypeInitializationException: The type initializer for 'Firebase.FirebaseApp' threw an exception.
Firebase.Firestore.FirebaseFirestore.get_DefaultInstance () (at /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/firestore/src/FirebaseFirestore.cs:129)
FirebaseManager.Start () (at Assets/Scripts/UI+Menu+Settings/FirebaseManager.cs:27)
If using CocoaPods for Apple platforms, the project's Podfile.lock
Expand Podfile.lock
snippet
👀 Replace this line with the contents of your Podfile.lock!