firebase-unity-sdk icon indicating copy to clipboard operation
firebase-unity-sdk copied to clipboard

[Bug] Error caught by debugger on each recompile when in play mode

Open tomkail opened this issue 1 year ago • 6 comments

Description

When my debugger (Rider) is connected, each time Unity recompiles due to code being edited while Unity is running, the follow exception is thrown. This makes it very annoying to leave my debugger attached.

System.ArgumentNullException: "_p_firebase__firestore__csharp__TransactionManager" has been disposed at Firebase.Firestore.TransactionManagerProxy.CppDispose () [0x00016] in /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/linux_unity/firestore/swig/Firebase.Firestore_fixed.cs:3644 at Firebase.Firestore.TransactionManager.Dispose () [0x0000d] in /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/firestore/src/TransactionManager.cs:63 at Firebase.Firestore.FirebaseFirestore.Dispose () [0x0004c] in /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/firestore/src/FirebaseFirestore.cs:96 at Firebase.Firestore.FirebaseFirestore.Finalize () [0x00002] in /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/firestore/src/FirebaseFirestore.cs:76

Reproducing the issue

Run your project, connect your debugger, change some code to force unity to compile.

Firebase Unity SDK Version

12

Unity editor version

2022.x.x

Installation Method

.unitypackage

Problematic Firebase Component(s)

Firestore

Other Firebase Component(s) in use

Firestore

Additional SDKs you are using

No response

Targeted Platform(s)

Apple Platforms

Unity editor platform

Mac

Scripting Runtime

IL2CPP

Release Distribution Type

Pre-built SDK from https://firebase.google.com/download/unity

Relevant Log Output

System.ArgumentNullException: "_p_firebase__firestore__csharp__TransactionManager" has been disposed
  at Firebase.Firestore.TransactionManagerProxy.CppDispose () [0x00016] in /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/linux_unity/firestore/swig/Firebase.Firestore_fixed.cs:3644 
  at Firebase.Firestore.TransactionManager.Dispose () [0x0000d] in /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/firestore/src/TransactionManager.cs:63 
  at Firebase.Firestore.FirebaseFirestore.Dispose () [0x0004c] in /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/firestore/src/FirebaseFirestore.cs:96 
  at Firebase.Firestore.FirebaseFirestore.Finalize () [0x00002] in /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/firestore/src/FirebaseFirestore.cs:76

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!

tomkail avatar Jun 19 '24 14:06 tomkail

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Jun 19 '24 14:06 google-oss-bot

Hey @tomkail , thanks for reporting. Does the issue occur consistently? Would you be able to give me a full log?

It looks as though there's a race condition and the code is trying to dispose of something that's already been disposed.

ehsannas avatar Jun 21 '24 20:06 ehsannas

Yeah, it's been happening fairly consistently since I've been using the package, over a year. I wrote in via the website (since that's where the downloads for Unity are hosted) but never heard back; I only realised this github existed recently. How can I get the full log?

tomkail avatar Jun 24 '24 07:06 tomkail

Set FirebaseFirestore.LogLevel = LogLevel.Debug as early as possible in your application. Reproduce the crash. Depending on your environment you should be able to find the crash log.

ehsannas avatar Jun 24 '24 20:06 ehsannas

Was there any resolution on this? I've also had the exact same issue for over a year and I've finally gotten sick of it enough to do something about it.

solarsmithjake avatar Jan 09 '25 21:01 solarsmithjake

Same here. Very annoying.

UmberFunk avatar Apr 22 '25 18:04 UmberFunk