命令行 – 使用mdtool编译monotouch应用程序失败,适用于MonoDevelop

我有一个Monotouch iPad应用程序,我正在尝试设置一个自动构建脚本.我试图使用mdtool,但我似乎打了墙.如果我使用MonoDevelop GUI构建解决方案,它会成功构建.但是,如果我清理该解决方案并使用mdtool进行构建,则会在未知文件获取有关空引用异常的异常.

过去几个小时,我已经搜索了一下.我以为我在Stack Overflow上找到了几条线索,但是他们似乎都是不一样的.没有太多关于在UI中成功构建和CLI上的故障.

这里有一些输出

Performing main compilation...
        Updating CodeBehind files
ERROR [2011-06-03 11:27:52Z]: Error generating code for xib file '/Users/Me/Documents/Code/MyApp/MainWindow.xib'
System.NullReferenceException: Object reference not set to an instance of an object at MonoDevelop.DesignerSupport.CodeBehindWriter.<get_OpenFiles>m__21 () [0x00000] in <filename unk@R_502_6363@n>:0 
at MonoDevelop.Ide.dispatchService.Guisyncdispatch (MonoDevelop.Ide.MessageHandler cb) [0x00000] in <filename unk@R_502_6363@n>:0 
at MonoDevelop.DesignerSupport.CodeBehindWriter.get_OpenFiles () [0x00000] in <filename unk@R_502_6363@n>:0 
at MonoDevelop.DesignerSupport.CodeBehindWriter.Write (System.CodeDom.CodeCompileUnit ccu,FilePath path) [0x00000] in <filename unk@R_502_6363@n>:0 
at MonoDevelop.MacDev.XibCodeBehind.GenerateDesignerCode (MonoDevelop.DesignerSupport.CodeBehindWriter writer,MonoDevelop.Projects.ProjectFile xibFile,MonoDevelop.Projects.ProjectFile designerFile) [0x00000] in <filename unk@R_502_6363@n>:0 
at MonoDevelop.MacDev.MacBuildUtilities.UpdateCodeBehind (IProgressMonitor monitor,MonoDevelop.MacDev.XibCodeBehind generator,IEnumerable`1 items) [0x00000] in <filename unk@R_502_6363@n>:0

我执行的命令如下所示:

/Applications/MonoDevelop.app/Contents/MacOS/mdtool -v build "--configuration:Release|iPhone" "/Users/Me/Documents/Code/MyApp/MyApp.sln"

只是为了保持彻底,这里是我的版本:

OS X: 10.6.7
    XCode: 3.2.6
    iOS SDK: 4.3
    Mono: 2.10.2
    MonoDevelop: 2.4.2
    MonoTouch: 4.0.3

更新(6/7/2011):

作为替代,我尝试做mdtool generate-makefiles.它创建了一切可以期待的东西,并且./configure运行正常,但是失败非常糟糕.如果任何人有任何想法,我很乐意解决这个问题.

解决方法

这是一个错误,但是只有xib或项目(csproj)文件比设计器文件更新,才会生成设计器代码.在IDE中构建一次或“触摸”设计器文件,mdtool将再次工作.

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...