Quickstart-unity: Storage Quickstart broken on Unity 2017.2.0f3

Created on 23 Oct 2017  Â·  8Comments  Â·  Source: firebase/quickstart-unity

Using SDK version 4.2.1
Mac OSX Sierra

Upload fails with error:
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.WWW.get_responseHeaders () (at /Users/builduser/buildslave/unity/build/Runtime/WebRequestWWW/UWRWWW.cs:158)
Firebase.Unity.WWWHttpRequest.TryParseResponse (UnityEngine.WWW www)
Firebase.Unity.WWWHttpRequest+c__Iterator0.MoveNext ()
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at /Users/builduser/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)

Download succeeds

bug

Most helpful comment

Hi Kiana, thank you for the report, we could reproduce it.

It looks like Unity introduced a bug in their WWW class between 2017.2.0b8 and 2017.2.0f2. When the server responds with an empty (0 bytes) file, accessing WWW.responseHeaders throws a NullReferenceException.
We are now looking into whether we can provide a workaround or whether we need Unity to fix that.

In the meantime, if you need 2017.2 features, the beta version 2017.2.0b8 still works with Firebase 4.2.1.

Sorry for the inconvenience,
Patrick

All 8 comments

The same setup works with Unity 5.6.3f1

Hi Kiana, thank you for the report, we could reproduce it.

It looks like Unity introduced a bug in their WWW class between 2017.2.0b8 and 2017.2.0f2. When the server responds with an empty (0 bytes) file, accessing WWW.responseHeaders throws a NullReferenceException.
We are now looking into whether we can provide a workaround or whether we need Unity to fix that.

In the meantime, if you need 2017.2 features, the beta version 2017.2.0b8 still works with Firebase 4.2.1.

Sorry for the inconvenience,
Patrick

Can confirm issues on unity 5.6.3p1 firebase 4.2.1

I have exactly the same problem! (Unity 2017.1.2f1) (Firebase 4.2.1)

Are there any recommendations?

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.WWW.get_responseHeaders () (at C:/buildslave/unity/build/Runtime/WebRequestWWW/UWRWWW.cs:158)
Firebase.Unity.WWWHttpRequest.TryParseResponse (UnityEngine.WWW www)
Firebase.Unity.WWWHttpRequest+c__Iterator0.MoveNext ()
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)

Unfortunately there is no good solution. You have to downgrade your Unity
version.
And this will be a patch level downgrade. E.g. 5.6.3p4 is broken, but
5.6.3p3 works. 2017.2.0f2 is broken, but 2017.2.0b8 (beta) works. I don't
know exactly which versions work or not, I'd try versions released before
Sep 14th.
Unity claims that it will be fixed in "a future release" (likely the next
one).

A workaround would be extremely difficult on our side, as we'd have to
change the Firebase server code to never return an empty response body
and then make sure that this doesn't inadvertently break any of our SDKs.

I also did not expect Unity to take that long to fix this regression.

On Tue, Nov 28, 2017 at 8:46 AM Andreas Berger notifications@github.com
wrote:

I have exactly the same problem! (Unity 2017.1.2f1) (Firebase 4.2.1)

Are there any recommendations?

NullReferenceException: Object reference not set to an instance of an
object
UnityEngine.WWW.get_responseHeaders () (at
C:/buildslave/unity/build/Runtime/WebRequestWWW/UWRWWW.cs:158)
Firebase.Unity.WWWHttpRequest.TryParseResponse (UnityEngine.WWW www)
Firebase.Unity.WWWHttpRequest+c__Iterator0.MoveNext ()
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr
returnValueAddress) (at
C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/firebase/quickstart-unity/issues/118#issuecomment-347528047,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Ad_ZzWF1BPdL3JPtmHIaddxZi2DtwZGmks5s7A7IgaJpZM4QDOhw
.

I just saw that Unity now has fixed the issue and started releasing patched
versions. (Thank you, Elly)

Please download and use 2017.1.2p3, 2017.2.0p3 or 2017.3.0b10 (or higher).
The bug should be fixed in those versions.

On Tue, Nov 28, 2017 at 10:30 AM Patrick Hohmeyer phohmeyer@google.com
wrote:

Unfortunately there is no good solution. You have to downgrade your Unity
version.
And this will be a patch level downgrade. E.g. 5.6.3p4 is broken, but
5.6.3p3 works. 2017.2.0f2 is broken, but 2017.2.0b8 (beta) works. I don't
know exactly which versions work or not, I'd try versions released before
Sep 14th.
Unity claims that it will be fixed in "a future release" (likely the next
one).

A workaround would be extremely difficult on our side, as we'd have to
change the Firebase server code to never return an empty response body
and then make sure that this doesn't inadvertently break any of our SDKs.

I also did not expect Unity to take that long to fix this regression.

On Tue, Nov 28, 2017 at 8:46 AM Andreas Berger notifications@github.com
wrote:

I have exactly the same problem! (Unity 2017.1.2f1) (Firebase 4.2.1)

Are there any recommendations?

NullReferenceException: Object reference not set to an instance of an
object
UnityEngine.WWW.get_responseHeaders () (at
C:/buildslave/unity/build/Runtime/WebRequestWWW/UWRWWW.cs:158)
Firebase.Unity.WWWHttpRequest.TryParseResponse (UnityEngine.WWW www)
Firebase.Unity.WWWHttpRequest+c__Iterator0.MoveNext ()
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr
returnValueAddress) (at
C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/firebase/quickstart-unity/issues/118#issuecomment-347528047,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Ad_ZzWF1BPdL3JPtmHIaddxZi2DtwZGmks5s7A7IgaJpZM4QDOhw
.

Still NullReferenceException in Unity 2017.3.0f3 with Firebase 4.3.0

We fixed some issues with .NET 4.6 in some versions of 2017.
https://firebase.google.com/support/release-notes/unity#4.4.3

Perhaps this resolved the issue?
Try our new Firebase Unity 4.4.3 release.

Was this page helpful?
0 / 5 - 0 ratings