android.netunity-game-engine.net-coreice

Null Exception when using ICE .netcore 2.0 inside Unity 2018.1 on Android


I get the following error when I use ice .netcore 2.0 dll from NuGet (https://www.nuget.org/packages/zeroc.ice.net) inside a Unity2018.1 project when running the project on Android. The same error occurs when using the .Net 4.5 .dll variant inside Unity2018 or Unity2017.

Runs ok inside the Editor on desktop but fails on Android:

NullReferenceException: Object reference not set to an instance of an object at IceInternal.ByteBuffer.putFloat (System.Single val) [0x00032] in <0ec35a220aea490187b153a1b6df7823>:0 at Ice.OutputStream.writeFloat (System.Single v) [0x00007] in <0ec35a220aea490187b153a1b6df7823>:0 at PiTracker.PiTrackerServerPrxHelper+<_iceI_getProjection>c__AnonStorey1.<>m__0 (Ice.OutputStream ostr) [0x00008] in /Users/xx/xx/:2049 at IceInternal.OutgoingAsync.invoke (System.String operation, Ice.OperationMode mode, Ice.FormatType format, System.Collections.Generic.Dictionary`2[TKey,TValue] context, System.Boolean synchronous, System.Action`1[T] write) [0x00020] in <0ec35a220aea490187b153a1b6df7823>:0 at IceInternal.OutgoingAsyncT`1[T].invoke (System.String operation, Ice.OperationMode mode, Ice.FormatType format, System.Collections.Generic.Dictionary`2[TKey,TValue] context, System.Boolean synchronous, System.Action`1[T] writ

I found an old forum entry regarding this topic https://forums.zeroc.com/discussion/5730/ice-on-mono-on-android but that seems not to be valid anymore because the ICE build script doesn't allow for a managed build anymore. I've also asked on the ICE forum but only with the answer that on Unity2018 using .netcore 2.0 it should work, but it does not.

Any help highly appreciated.


Solution

  • The team from ZeroC answered this question. It was actually a bug inside their CSharp code base. https://forums.zeroc.com/discussion/46631/build-ice-3-7-1-with-option-managed-yes-on-macos-or-windows#latest

    As of now if you are facing this issue you need to build ICE from the 3.7 branch (https://github.com/zeroc-ice/ice/tree/3.7) for .NET yourself following their build instructions: https://github.com/zeroc-ice/ice/tree/3.7/csharp