升级到Monotouch 4.0后出现MissingMethodException

时间:2011-04-07 16:35:18

标签: c# iphone mono xamarin.ios monodevelop

有没有人使用优秀的Sparrow 2D monotouch库?

https://github.com/trustme/Sparrow

我刚刚更新到Monotouch 4.0和Monodevelop 2.4.2,以及何时 重建并运行SparrowTest给了我这个奇怪的错误:

System.MissingMethodException has been thrown "Method not found:
'Monotouch.ObjCRuntime.Messaging.void_objc_msgSend_Boolean'." at
SparrowTest.AppDelegateIPhone.FinishedLaunching in
AppDelegateIPhone.cs:23

方法是:

SPStage.SupportHighResolutions = true;

当评论时,它会在许多其他方法上给出相同的错误。我有 尝试使用不同的sdk版本,但问题仍然存在。

任何线索?

3 个答案:

答案 0 :(得分:2)

你需要使用btouch为MonoTouch 4重新生成sparrow.dll。

答案 1 :(得分:0)

尝试使用-out创建脚本以重新生成第三方库 避免这个问题的另一种方法是,你的项目的构建输出选择:不要链接程序集 并且您的项目将起作用

答案 2 :(得分:0)

问题解决了!

使用MonoTouch 4.0,我们必须使用smcs而不是gmcs。

以下是使用MonoTouch 4.0生成sparrow.dll的正确步骤,分两步:

/ Developer / MonoTouch / usr / bin / btouch sparrow.cs -s:enum.cs --outdir = gen -ns = Sparrow --unsafe --sourceonly = genfiles

/ Developer / MonoTouch / usr / bin / smcs -out:sparrow.dll cat genfiles extensions.cs -unsafe -r:/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll enum。 cs -target:library

感谢Geoff Norton和Duane Wandless的帮助!