【问题标题】:MonoTouch: Using ServiceStack caused JIT error?MonoTouch:使用 ServiceStack 导致 JIT 错误?
【发布时间】:2013-02-23 00:09:31
【问题描述】:

我正在使用来自 https://github.com/ServiceStack/ServiceStack/tree/master/release/latest/MonoTouch 的 MonoTouch 构建的服务堆栈

在 iPad 上运行时,我收到 JIT 错误。我认为 MonoTouch 在构建中解决了这个问题?

Attempting to JIT compile method     
'ServiceStack.Text.Json.JsonReader`1<Common.AppCategoryEnum>:GetParseFn ()' while running 
with --aot-only.

我使用 DLLS:

  • ServiceStack.Common.dll
  • ServiceStack.Interface.dll
  • ServiceStack.Text.dll

而且只有这一次调用:

new JsonServiceClient ().GetAsync<MyResponse> (url, Success, Failure);

【问题讨论】:

  • 您使用的是 MonoTouch 5.2.x 还是 5.3.x ?
  • MonoDevelop 2.8.8.4 安装 UUID: 438ac2b5-07c9-45e7-a8ce-eac5ad86371d 运行时: Mono 2.10.9 (tarball Tue Mar 20 15:31:37 EDT 2012) GTK 2.24.10 GTK# ( 2.12.0.0) Apple 开发者工具:Xcode 4.3.1 (1176) Build 4E1019 Monotouch:5.2.10
  • 错误报告中的更多详细信息填写为bugzilla.xamarin.com/show_bug.cgi?id=4381

标签: c# xamarin.ios monodevelop jit servicestack


【解决方案1】:

我正在使用来自

的服务堆栈的 MonoTouch 构建

这些 .dll 超过 3 个月大,一个月前发现并修复了 similar 问题。

我收到 JIT 错误。我认为 MonoTouch 在构建中解决了这个问题?

是的。为 MonoTouch 构建时,使用了 AOT(提前)编译器。它编译所有它知道在运行时需要的东西。

但有时 AOT 编译器无法了解所有内容(例如通用虚拟方法)编译所有可能的变体(例如值类型)。请参阅文档网站中的generic limitations 部分。在这种情况下,它的 AOT 编译器可能需要帮助(确保编译正确代码的签名,例如 this 之类的东西)。

这也可能是一个错误——由于某种原因,所需的方法没有被 AOT'ed。当发现这一点时,在运行时会发生异常,因为缺少代码并且无法使用 JIT 来提供它。

【讨论】:

    【解决方案2】:

    我知道创建此线程已经很长时间了,但我在这里和那里找到了一种解决方法 只需在 FinishedLaunching 方法的 AppDelegate 中调用 var dummy = new JsonSerializer() 即可。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-12
      相关资源
      最近更新 更多