Delphi Tokyo 10.2 - 710无效的二进制存储格式

时间:2017-06-27 14:59:43

标签: delphi datasnap firedac

我正在使用REST / Jason处理firemonkey,但是,当我通过DataSnap客户端类连接到我的方法服务器以获取我的查询的返回时,以下行抛出异常:

Result := TFDJSONDataSets(FUnMarshal.UnMarshal(FGetAlunoAutenticacaoCommand.Parameters[3].Value.GetJSONValue(True)));

enter image description here

重要的:

不言而喻,问题只发生在iOS模拟器中。

当我使用ANDROID或WIN32时,问题不会发生。

enter image description here

有人有任何建议吗?

1 个答案:

答案 0 :(得分:1)

我在iOS上遇到了同样的错误。 经过一番调查,我发现这个错误导致了Embarcadero的源代码中的错误。

单位Data.FireDACJSONReflect具有功能MemTableFromString(...)。在此函数内,行(435)LMemoryStream.Seek(Longint(0), soFromBeginning);意味着将LMemoryStream.Position设置为0。它适用于除iOS以外的所有平台(我在Win32 / 64和Android上测试过)。在iOS上它什么都不做。 (Seek函数调用的实际参数变为0soCurrent)。

刚刚更改了单位Data.FireDACJSONReflect

中的这一行(435)
LMemoryStream.Seek(Longint(0), soFromBeginning);

到正确的

LMemoryStream.Seek(0, TSeekOrigin.soBeginning);

(您需要在某处保存更正的单位,将其添加到您的项目中,并使用源代码的uses子句中的新单位替换旧单位)