当我在Android上运行项目时,在Unity2018.1项目中使用来自NuGet(https://www.nuget.org/packages/zeroc.ice.net)的ice .netcore 2.0 dll时出现以下错误。 在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论坛上询问,但只有在Unity2018上使用.netcore 2.0的答案应该有效,但事实并非如此。
任何帮助高度赞赏。
答案 0 :(得分:0)
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)为.NET构建ICE:https://github.com/zeroc-ice/ice/tree/3.7/csharp