如何编译MonoTouch的库(得到错误:试图JIT编译与--aot只) [英] How to compile libraries with monotouch (getting error : attempting to JIT-compile with --aot-only)

查看:231
本文介绍了如何编译MonoTouch的库(得到错误:试图JIT编译与--aot只)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用 DotNetZip HTTP://dotnetzip.codeplex.com /在MonoTouch的项目)。

我已经重新编译它的的MonoTouch ,通过使两个新的MonoTouch项目的MonoDevelop(一个zlib的,另一个用于DotNetZip)下,把code里面,删除code表示引用Windows窗体,并设置编译目标 = 项目选择。

我在MonoDevelop中设置主动配置发布 - iPhone重新设置。

然后,我在我的主MonoTouch的项目中引用所产生的动态链接库。

在模拟器上运行时工作正常,但是当我尝试调试这个实际的设备(在iPod touch 4在我的情况),我得在运行时出现错误:

System.ExecutionEngineException已引发

试图JIT编译的方法。Vortaro.SearchTableViewSource:.ctor(Vortaro.SearchViewController),同时与--aot只运行

这是发生在这条线:

 使用(的ZipFile邮编= ZipFile.Read(dictionary.zip)){
 

-

我还测试一个简单的例子,只有做到这一点是单击按钮时:

  ZipFile.Read(dictionary.zip);
 

和我得到这个错误:

未处理的异常:System.ExecutionEngineException: 试图JIT编译的方法Ionic.Zip.ZipContainer:.ctor(对象),与--aot,只有运行时

在Ionic.Zip.ZipEntry.ReadDirEntry(Ionic.Zip.ZipFile ZF)0x000b5]在/用户/(...)/ ZipDirEntry.cs:199

当我看到的错误点,我看不到任何可能导致JIT编译的构造器:

 公共ZipContainer(对象o)
{
    _zf =(邻为ZipFile的);
    _zos =(邻为ZipOutputStream);
    _zis =(邻为ZipInputStream);
}
 

解决方案

这是iOS的强加的限制:这是不可能产生对德曼code。所以,你需要igure出来的问题是,为什么你的code试图JIT编译Vortaro.SearchTableViewSource.ctor,可以这样做可能是因为你有一个使用它的泛型类型,或者您调用Type.GetType ()

该错误看起来并不像它来自dotnetzip库,而不是它看起来像它来自你的code(见的类型名称)

I'm trying to use DotNetZip (http://dotnetzip.codeplex.com/) in a monotouch project.

I have re-compiled it for monotouch, by making two new monotouch projects under MonoDevelop (one for ZLib and the other for DotNetZip), putting the code inside, removing code that references Windows Forms, and setting Compile Target = Library in the project options.

I set the active configuration in MonoDevelop to "Release - iPhone" before compiling.

Then, I referenced the resulting DLLs in my main monotouch project.

That works fine when running in the simulator, but when I try to debug this on the actual device (an iPod Touch 4 in my case), I get an error at runtime:

System.ExecutionEngineException has been thrown

Attempting to JIT compile method 'Vortaro.SearchTableViewSource:.ctor (Vortaro.SearchViewController)' while running with --aot-only.

That happens on this line:

using (ZipFile zip = ZipFile.Read ("dictionary.zip")) {

--

I also tested with a simple example that only does this when a button is clicked:

ZipFile.Read ("dictionary.zip");

and I get this error:

Unhandled Exception: System.ExecutionEngineException: Attempting to JIT compile method 'Ionic.Zip.ZipContainer:.ctor (object)' while running with --aot-only.

at Ionic.Zip.ZipEntry.ReadDirEntry (Ionic.Zip.ZipFile zf) [0x000b5] in /Users/(...)/ZipDirEntry.cs:199

When I look at the constructor to which the error points, I fail to see anything that could cause the JIT compilation:

public ZipContainer(Object o)
{
    _zf = (o as ZipFile);
    _zos = (o as ZipOutputStream);
    _zis = (o as ZipInputStream);
}

解决方案

This is a limitation imposed by the iOS: it is not possible to generate code on deman. So the issue that you need to igure out is why your code is trying to JIT compile the Vortaro.SearchTableViewSource.ctor, this could be done either because you had a generic type that uses it, or you are calling Type.GetType ()

The error does not look like it comes from the dotnetzip library, instead it looks like it comes from your code (See the type name)

这篇关于如何编译MonoTouch的库(得到错误:试图JIT编译与--aot只)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆