XCode 7:xcdatamodeld不存在 [英] XCode 7: xcdatamodeld doesn’t exist

查看:96
本文介绍了XCode 7:xcdatamodeld不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在为了支持iOS9而更新到XCode 7之后,我遇到了以下构建错误

error: Cannot read bundle contents (Error Domain=NSCocoaErrorDomain Code=260 "The folder VoIP.xcdatamodeld doesn’t exist.

使用配置Debug构建项目myTitle的目标myTitle

DataModelCompile构建/产品/Debug-iphoneos/myTitle.app/ /Users/myself/MyDev/m1/app/VoIP/VoIP/VoIP.xcdatamodeld cd/Users/myself/MyDev/m1/app/app/iPhone 导出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代码= 260 文件夹"VoIP.xcdatamodeld"不存在." UserInfo = 0x7fd0f350f990 {NSFilePath =/Users/myself/MyDev/m1/app/VoIP/VoIP/VoIP.xcdatamodeld, NSUserStringVariant =( 文件夹),NSUnderlyingError = 0x7fd0f350f940操作无法完成.(OSStatus错误-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版本中没有问题.

解决方案

Build Phases (构建阶段)下检查编译源,如下图所述. >



我仔细查看了所有资源,发现一个没有任何路径的资源(一个未知资源,我不知道它在其中的样子..).从那里删除它,清洁产品并运行.

以上是我这种情况的唯一原因.

希望它可以帮助您!

After updating to XCode 7 in order to support iOS9 I had the following build error

error: Cannot read bundle contents (Error Domain=NSCocoaErrorDomain Code=260 "The folder "VoIP.xcdatamodeld" doesn’t exist.

Build target myTitle of project myTitle with configuration Debug

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:: error: Cannot read bundle contents (Error Domain=NSCocoaErrorDomain Code=260 "The folder "VoIP.xcdatamodeld" doesn’t exist." UserInfo=0x7fd0f350f990 {NSFilePath=/Users/myself/MyDev/m1/app/VoIP/VoIP/VoIP.xcdatamodeld, NSUserStringVariant=( Folder ), NSUnderlyingError=0x7fd0f350f940 "The operation couldn’t be completed. (OSStatus error -43.)"})

How can I resolve it?

The only reference about this file in my project is this one (in the .project file)

/* 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 */

No idea how it came from and why it worked w/o problems in previous xcode versions.

解决方案

Check Compile Sources under Build Phases for your Target setting described in the below image.



I saw all the resources carefully and found one resource without any path (an unknown resource, I don't know how it appeared there..). Remove it from there, clean the product and run.

The above was the only reason in my case..

Hope it helps you !!!

这篇关于XCode 7:xcdatamodeld不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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