【发布时间】:2015-09-30 13:56:52
【问题描述】:
更新到 XCode 7 以支持 iOS9 后,我遇到了以下构建错误
error: Cannot read bundle contents (Error Domain=NSCocoaErrorDomain Code=260 "The folder “VoIP.xcdatamodeld” doesn’t exist.
使用配置Debug构建项目myTitle的目标myTitle
DataModelCompile Build/Products/Debug-iphoneos/myTitle.app/ /Users/myself/MyDev/m1/app/VoIP/VoIP/VoIP.xcdatamodeld cd /Users/myself/MyDev/m1/app/app/iPhone export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/ usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/usr/bin/momc --sdkroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk --iphoneos-deployment-target 7.0 --module myTitle /Users/myself/MyDev/m1/app/VoIP/VoIP/VoIP.xcdatamodeld /Users/myself/MyDev/m1/app/app/iPhone/Build/Products/Debug-iphoneos/myTitle.app/
/Users/myself/MyDev/m1/app/VoIP/VoIP/VoIP.xcdatamodeld:: 错误:不能 读取包内容(错误域=NSCocoaErrorDomain Code=260“的 文件夹“VoIP.xcdatamodeld”不存在。” UserInfo=0x7fd0f350f990 {NSFilePath=/Users/myself/MyDev/m1/app/VoIP/VoIP/VoIP.xcdatamodeld, NSUserStringVariant=( Folder ), NSUnderlyingError=0x7fd0f350f940 "操作无法完成。(OSStatus error -43.)"})
我该如何解决?
我的项目中关于这个文件的唯一参考是这个(在 .project 文件中)
/* Begin XCVersionGroup section */
449367DE1338E89100DB4AC9 /* myTitle.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
449367DF1338E89100DB4AC9 /* VoIP.xcdatamodel */,
);
currentVersion = 449367DF1338E89100DB4AC9 /* VoIP.xcdatamodel */;
name = myTitle.xcdatamodeld;
path = ../../../../VoIP/VoIP/VoIP.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
};
/* End XCVersionGroup section */
不知道它是如何产生的,以及为什么它在以前的 xcode 版本中没有问题。
【问题讨论】:
-
你检查过文件夹是否存在吗?
-
文件夹 VoIP/VoIP/VoIP.xcdatamodeld 不存在。它从来没有。
-
¯\_(ツ)_/¯ - 查找此引用的来源并修复它。
-
@Abizern 刚刚更新了我的答案。我 grepped 了项目层次结构,我在项目文件中只有一个引用。