Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Firebase Unity SDK stopped working on .NET 4.6 enabled

Discussion in '2017.1 Beta' started by 5argon, Jun 28, 2017.

  1. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    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.Task`1<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.
     
  2. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,307