“数据模型版本编译”..升级到 Lion (Xcode4.1) 后出错
自从昨天升级到 Lion(10.6->10.7)以来,我一直无法编译升级前编译没有问题的项目。
导致此错误的甚至不是最近对项目的更改:如果我从 SVN 签出几天或一周前的项目版本,我在构建时会遇到相同的错误:
"Command /Developer/usr /bin/momc 失败,退出代码 6"
,它扩展为以下内容:
构建错误:
DataModelVersionCompile /Users/ian/Library/Developer/Xcode/DerivedData/inventory-gtvznzuhomhlakbdpocaqwnrihhx/Build/Products/Debug-iphonesimulator/inventory.app/inventory.momd inventory/inventory.xcdatamodeld
cd /Users/ian/AppsDev/uk.co.isurvey-inventory/ios/inventory/trunk/inventory
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/usr/bin/momc -XD_MOMC_SDKROOT=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -XD_MOMC_IOS_TARGET_VERSION=4.3 -MOMC_PLATFORMS iphonesimulator -MOMC_PLATFORMS iphoneos -XD_MOMC_TARGET_VERSION=10.6 /Users/ian/AppsDev/uk.co.isurvey-inventory/ios/inventory/trunk/inventory/inventory/inventory.xcdatamodeld /Users/ian/Library/Developer/Xcode/DerivedData/inventory-gtvznzuhomhlakbdpocaqwnrihhx/Build/Products/Debug-iphonesimulator/inventory.app/inventory.momd
2011-07-21 19:24:44.954 momc[4436:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSXMLDocument initWithData:options:error:]: nil argument'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff8e411986 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff8d0d5d5e objc_exception_throw + 43
2 CoreFoundation 0x00007fff8e4117ba +[NSException raise:format:arguments:] + 106
3 CoreFoundation 0x00007fff8e411744 +[NSException raise:format:] + 116
4 Foundation 0x00007fff8c761310 -[NSXMLDocument initWithData:options:error:] + 89
5 momc 0x0000000102f04a2c momc + 10796
6 momc 0x0000000102f04fe8 momc + 12264
7 momc 0x0000000102f058f0 momc + 14576
8 momc 0x0000000102f03d20 momc + 7456
9 ??? 0x000000000000000a 0x0 + 10
)
terminate called throwing an exception
Command /Developer/usr/bin/momc failed with exit code 6
进一步说明:
AFAIK,唯一的区别是我现在使用 Lion,以及 Xcode 4.1 的 Lion 版本(在此之前我对 Snow Leopard 使用的是 Xcode 4.1)。
我删除了 /Developer/ ,重新安装了几次,并重新下载了 App Store Xcode 安装程序,以防它损坏。
如果我使用 Xcode 创建一个新项目(并使用 Core Data,我认为这与构建我的项目时遇到的任何问题有关),它会构建并运行良好:也许有我需要做些什么来修复我的实际项目?
任何建议都会很棒! 干杯, 伊恩
Since upgrading to Lion yesterday (10.6->10.7), I've been unable to compile a project that had no problems compiling prior to the upgrade.
It's not even a recent change to the project that's causing this error: If I checkout from SVN a version of the project from a few days or a week ago, I get the same error whilst building:
"Command /Developer/usr/bin/momc failed with exit code 6"
, which expands to the following:
Build Error:
DataModelVersionCompile /Users/ian/Library/Developer/Xcode/DerivedData/inventory-gtvznzuhomhlakbdpocaqwnrihhx/Build/Products/Debug-iphonesimulator/inventory.app/inventory.momd inventory/inventory.xcdatamodeld
cd /Users/ian/AppsDev/uk.co.isurvey-inventory/ios/inventory/trunk/inventory
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/usr/bin/momc -XD_MOMC_SDKROOT=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -XD_MOMC_IOS_TARGET_VERSION=4.3 -MOMC_PLATFORMS iphonesimulator -MOMC_PLATFORMS iphoneos -XD_MOMC_TARGET_VERSION=10.6 /Users/ian/AppsDev/uk.co.isurvey-inventory/ios/inventory/trunk/inventory/inventory/inventory.xcdatamodeld /Users/ian/Library/Developer/Xcode/DerivedData/inventory-gtvznzuhomhlakbdpocaqwnrihhx/Build/Products/Debug-iphonesimulator/inventory.app/inventory.momd
2011-07-21 19:24:44.954 momc[4436:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSXMLDocument initWithData:options:error:]: nil argument'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff8e411986 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff8d0d5d5e objc_exception_throw + 43
2 CoreFoundation 0x00007fff8e4117ba +[NSException raise:format:arguments:] + 106
3 CoreFoundation 0x00007fff8e411744 +[NSException raise:format:] + 116
4 Foundation 0x00007fff8c761310 -[NSXMLDocument initWithData:options:error:] + 89
5 momc 0x0000000102f04a2c momc + 10796
6 momc 0x0000000102f04fe8 momc + 12264
7 momc 0x0000000102f058f0 momc + 14576
8 momc 0x0000000102f03d20 momc + 7456
9 ??? 0x000000000000000a 0x0 + 10
)
terminate called throwing an exception
Command /Developer/usr/bin/momc failed with exit code 6
Further explanation:
AFAIK, the only difference is that I'm using Lion now, and the Lion version of Xcode 4.1 (where I was using Xcode 4.1 for Snow Leopard prior to this).
I've deleted /Developer/ , I've reinstalled several times, and re-downloaded the App Store Xcode installer too, in case it was corrupt.
If I create a new project using Xcode (and use Core Data, I think that's related to whatever problem there is building my project), it builds and runs fine: maybe there's something I need to do to fix my real project?
Any suggestions would be brilliant!
Cheers,
Ian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我遇到了同样的问题,OS X Lion 10.7.1,Xcode 4.1。
通过从 *.xcdatamodelid 目录中删除 Xcode 中未显示的所有 *.xcdatamodel 目录可以解决此问题。这些目录在 Xcode 中重命名 *.xcdatamodel 后出现。
可以在终端中通过 Finder 中的“显示包内容”菜单或右键单击 Xcode 中的 xcdatamodel 并选择“在 Finder 中显示”来完成删除。
I've had the same issue, OS X Lion 10.7.1, Xcode 4.1.
The problem is solved by removing all *.xcdatamodel directories that are not displayed in Xcode from your *.xcdatamodelid directory. These directories appear after *.xcdatamodel renaming in Xcode.
Removing may be done in Terminal, by “Show package contents” menu in Finder or by right-clicking on xcdatamodel in Xcode and selecting "Show in Finder".
重新启动 XCode 并删除 Derive Data 文件夹中的所有数据。
Restart XCode and delete all the data from the Derive Data Folder.
有趣的是,我发现在安装新版本的Xcode后出现了这种情况。这是由从安装的
DMG
运行 Xcode 引起的。我对这个问题进行了一番探讨,直到最终发现是使用 DMG 上的工具而不是复制到应用程序的文件进行构建。通过弹出 Xcode
DMG
解决了问题。我想我会发布这个以防它对其他人有利。
我怀疑此处和其他线程上发布的许多修复在某些情况下通过重新启动卸载
DMG
而起作用。Interestingly I found that I had this scenario after installing a new version of Xcode. It was caused by Xcode running from the mounted
DMG
. I chased the problem around for a bit until I eventually figured out it was doing the build using the tools on the DMG rather than the files copied to Applications.By ejecting the Xcode
DMG
it resolved the problem.Thought I'd post this in case it benefits anyone else.
I suspect a number of the fixes being posted here and on other threads are working in some cases by chance of a reboot unmounting the
DMG
.更新 OSX(小更新)后,我的 CI 突然遇到了这个问题。
Jenkins 无法构建任何 Obj-C 项目,并且总是因相同的错误而停止(不取决于项目/数据模型)。
解决方法是简单地删除衍生数据文件夹并重新启动计算机。
I suddenly had this trouble on my CI after updating OSX (minor update).
Jenkins couldn't build any Obj-C projects and always stopped with the same error (not depending on the project/datamodel).
The fix was to simply remove the derivedData folder and reboot the machine.