New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS sdk carashing with Unity 5.4.0 upwards versions! #492
Comments
Is there any update on this ? Also this happens only on device not in the unity editor! |
Had a user report same issue. Any updates? |
I'm seeing this happen as well. I'm not getting any equivalent error in the editor. Similar call stack to the one reported above. NullReferenceException: A null value was found where an object instance was required. |
This looks like the static constructor for DownloadHandlerBufferWrapper which sets up the "downloadHandlerBufferType" may not be getting called somehow or the types fetched inside of it are returning null. When the main ctor gets called it has a null reference to the type. I'm only seeing this on AOT platforms so it's possibly just a code stripping issue. |
Building against the class in the depot instead of the built assembly I see dig in and see the error on my AOT devices here It seems that the line before that
results in dataProperty being null Not sure if the interface changed in Unity or something else but still investigating. |
Looks like the property is stripped out at compile time, explicitly accessing the same property somewhere else in the code causes the property to be included. I've also tried adding it through the link.xml file as well but maybe I'm not setting syntax correctly. Anyway, even a simple touch of the .data property fixes this. I feel like I see this a lot in libraries these days but I've missed it myself when building for AOT platforms using reflection. I added a function like this to my startup and it gets me rolling for now.
I should note that the recommendation in Unity.README.md for modifications to the link.xml file doesn't fix this issue although I feel like it should so maybe something is wrong there?
|
Curious, have you tried to change occurrences of |
It's been a while since I've been working on this but at the time I had tried excluding both the experimental and non-experimental networking libraries from the stripper and was still seeing issues. Not sure if things are different now or if there was something wrong with way the link.xml was preserving files in that version as there has been a point update since then. |
We have noticed this issue has not recieved attention in 2 years. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue. |
Here is the log:
NullReferenceException: A null value was found where an object instance was required.
at Amazon.Runtime.Internal.DownloadHandlerBufferWrapper..cctor () [0x00000] in :0
at Amazon.Runtime.Internal.UnityMainThreadDispatcher+d__7.MoveNext () [0x00000] in :0
at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in :0
at UnityEngine.MonoBehaviour.StartCoroutine_Auto (IEnumerator routine) [0x00000] in :0
at UnityEngine.MonoBehaviour.StartCoroutine (IEnumerator routine) [0x00000] in :0
at Amazon.Runtime.Internal.UnityMainThreadDispatcher.ProcessRequests () [0x00000] in :0
at Amazon.Runtime.Internal.UnityMainThreadDispatcher.Update () [0x00000] in :0 Rethrow as TypeInitializationException: The type initializer for 'Amazon.Runtime.Internal.DownloadHandlerBufferWrapper' threw an exception.
at Amazon.Runtime.Internal.UnityMainThreadDispatcher+d__7.MoveNext () [0x00000] in :0
at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in :0
at UnityEngine.MonoBehaviour.StartCoroutine_Auto (IEnumerator routine) [0x00000] in :0
at UnityEngine.MonoBehaviour.StartCoroutine (IEnumerator routine) [0x00000] in :0
at Amazon.Runtime.Internal.UnityMainThreadDispatcher.ProcessRequests () [0x00000] in :0
at Amazon.Runtime.Internal.UnityMainThreadDispatcher.Update () [0x00000] in :0
UnityEngine.MonoBehaviour:StartCoroutine_Auto(IEnumerator)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)Amazon.Runtime.Internal.UnityMainThreadDispatcher:ProcessRequests()
Amazon.Runtime.Internal.UnityMainThreadDispatcher:Update()
(Filename: currently not available on il2cpp Line: -1)
The text was updated successfully, but these errors were encountered: