Quickstart-unity: FirebaseDatabase broken in Unity 2017.2.0b8 .NET 4.6

Created on 28 Aug 2017  路  8Comments  路  Source: firebase/quickstart-unity

Enabling .NET 4.6 Player runtime in Unity 2017.2 beta breaks the Firebase Unity SDK 4.1.0. FirebaseDatabase transactions no longer successfully result in either an error or response object.

To reproduce:

  • download the latest 2017.2.0b8 beta https://unity3d.com/unity/beta
  • enable the .NET 4.6 Player runtime
  • clone & run the Firebase quickstart testapp
  • try either the Parse/Plugins/Unity.tasks dll or Parse/Pugins/dotNet45/Unity.tasks dll
  • run the project in the editor, enter an email and observe the transaction does not complete

Expected Result:

  • the RunTransaction task handler to log either an error, or the success message.

Actual Outcome:

  • the application does not proceed further than logging "Running Transaction"

More info: https://forum.unity3d.com/threads/unity-2017-net-4-6-firebase-scripting-runtime-websocket-errors.476078/

bug

Most helpful comment

@ItsLeeOwen thank you for the report. We could reproduce the issue and tracked it to a regression in Unity.

Calling SslStream.AuthenticateAsClient raises a DllNotFoundException. This seems specific to Unity 2017.2.0 .NET 4.6 on macOS. We reported it to Unity, who could reproduce it, see: https://fogbugz.unity3d.com/default.asp?946207_prs3gppf9ssb5t2d . Unfortunately I don't see any workaround that we could implement while we wait for Unity to fix the regression on their side.

Also, the issue seems specific to _macOS_, so FirebaseDatabase should work on all other platforms (including iOS) even with Unity 2017.2.0 .NET 4.6.

All 8 comments

With Unity 2017.1.0f1 on OSX with Firebase Unity SDK 4.1.0 the sample works fine for me.

unity2017-dotnet46-transaction-complete

Parse/Plugins/Unity.tasks dll will not work with the .NET 4.6 runtime as it duplicates the implementation of System.Tasks.

You need to use Parse/Pugins/dotNet45/Unity.tasks dll which forwards the implementation to the .NET runtime libraries.

Perhaps you're testing on a different platform?

@stewartmiles I'm on OSX with Unity 2017.2.0b8. I removed + reimported Unity SDK 4.1.0 FirebaseDatabase.unitypackage within quickstart-unity/database/testapp, without luck, the transaction still does not complete. I'll try downgrading to Unity 2017.1.0f1

@ItsLeeOwen could you verify that you're seeing a valid database URL?
https://github.com/firebase/quickstart-unity/blob/master/database/testapp/Assets/TestApp/UIHandler.cs#L71

If this is not set to a valid URL transactions will not complete.

Cheers,
Stewart

@stewartmiles yes, I verified by testing the .NET 35 setting, which successfully wrote to my firebase uri

Unity 2017.1.0f3 works with .NET 4.6. Updating the issue title to specify Unity 2017.2 beta

@ItsLeeOwen thank you for the report. We could reproduce the issue and tracked it to a regression in Unity.

Calling SslStream.AuthenticateAsClient raises a DllNotFoundException. This seems specific to Unity 2017.2.0 .NET 4.6 on macOS. We reported it to Unity, who could reproduce it, see: https://fogbugz.unity3d.com/default.asp?946207_prs3gppf9ssb5t2d . Unfortunately I don't see any workaround that we could implement while we wait for Unity to fix the regression on their side.

Also, the issue seems specific to _macOS_, so FirebaseDatabase should work on all other platforms (including iOS) even with Unity 2017.2.0 .NET 4.6.

Update: Unity fixed this in 2017.3
I tested it with 2017.3.0b6 on macOS and FirebaseDatabase works as expected.
2017.2.0f2 is still broken and I don't know if Unity will ever back-port their fix.

We fixed some spotty .NET 4.6 issues with 2017 regarding whether or not to use a work-around.
https://firebase.google.com/support/release-notes/unity#4.4.3

Try our new release of Firebase Unity 4.4.3

Was this page helpful?
0 / 5 - 0 ratings