在 Android 上的 Unity 2018.1 中使用 ICE .netcore 2.0 时出现空异常



当我在 Unity2018.1 项目中使用来自 NuGet (https://www.nuget.org/packages/zeroc.ice.net( 的 ice .netcore 2.0 dll 时,我在 Android 上运行该项目时收到以下错误。 在 Unity2018 或 Unity2017 中使用 .Net 4.5 .dll 变体时,会出现相同的错误。

在桌面上的编辑器中运行正常,但在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

我 https://forums.zeroc.com/discussion/5730/ice-on-mono-on-android 找到了一个关于这个主题的旧论坛条目,但这似乎不再有效,因为 ICE 构建脚本不再允许托管构建。我也在ICE论坛上问过,但只是回答说,在使用.netcore 2.0的Unity2018上,它应该可以工作,但它没有。

任何帮助都非常感谢。

ZeroC的团队回答了这个问题。这实际上是他们CSharp代码库中的一个错误。 https://forums.zeroc.com/discussion/46631/build-ice-3-7-1-with-option-managed-yes-on-macos-or-windows#latest

截至目前,如果您遇到此问题,则需要按照构建说明从 .NET 的 3.7 分支 (https://github.com/zeroc-ice/ice/tree/3.7( 构建 ICE:https://github.com/zeroc-ice/ice/tree/3.7/csharp

最新更新