Firebase Unity SDK stopped working on .NET 4.6 enabled

This is on their part, not Unity’s fault. But since I think Firebase user might be a lot I want to post the issue here just in case anyone is searching for the solution.

Firebase shipped with System.Threading.Tasks (https://firebase.google.com/docs/reference/unity/namespace/system/threading/tasks) since .NET 3.5 doesn’t has it. Now that .NET 4.6 has it.

  1. If I do using System.Threading.Task in my program it will confuse whether to use Firebase’s or .NET 4.6 ones. (Defined multiple times error)

  2. If I remove Firebase’s Unity.Task.dll file in order to force the project to use the .NET ones then it is good on my project, but I have no control over Firebase code because they did not open source it. All Task reference in Firebase-unity stop working because they all reference to their own Task that I just removed.

error CS0012: The type System.Threading.Tasks.Task1<Firebase.Storage.StorageMetadata>’ is defined in an assembly that is not referenced. Consider adding a reference to assembly `Unity.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’

This is from Firebase.Storage’s PutStreamAsync which contains Task in its method definition. I wish Firebase make a new library that targets .NET 4.6 soon.

Note that the “Consider adding a reference to assembly `Unity.Tasks” is also erroneous just because Unity also have the class named Tasks.

Ditch the colossal failure that is Firebase Unity SDK and go with good old C#:

I’ve never looked back.

  • you get cloud build :wink:
4 Likes