路径上的数据模型编译失败

时间:2021-09-13 09:44:47

I'm trying to release an app to the app store tonight. I've been developing the Xcode 6 - Beta 2 for the past few months (Objective-C only) and didn't know you were not allowed to submit via Xcode Beta. So, I opened the project in plain Xcode and upon an attempt to re-archive the project received the following error:

我正试图在今晚向应用程序商店发布应用程序。我过去几个月一直在开发Xcode 6-Beta 2(仅限Objective-C),并且不知道你不能通过Xcode Beta提交。所以,我在普通Xcode中打开了项目,并在尝试重新存档项目时收到以下错误:

Compilation failed for data model at path '/Users/ME/Library/Developer/Xcode/DerivedData/ProjectDataFolder/Build/Products/Debug-iphoneos/Project.app/Model.momd/Model.mom'

路径'/Users/ME/Library/Developer/Xcode/DerivedData/ProjectDataFolder/Build/Products/Debug-iphoneos/Project.app/Model.momd/Model.mom'中数据模型的编译失败

I tried deleting the derived data, cleaning the build folder, etc etc the standard stuff. I also tried cleaning the archives folder and the simulator apps folder. Neither worked. However, reopening the app in Xcode Beta worked on the first try. Back to Xcode, same error occurred.

我尝试删除派生数据,清理构建文件夹等标准的东西。我还尝试清理archives文件夹和模拟器应用程序文件夹。都没有奏效。但是,在Xcode Beta中重新打开应用程序是第一次尝试。回到Xcode,发生了同样的错误。

Any help would be greatly appreciaed.

任何帮助都会非常感激。

5 个解决方案

#1


51  

I had this problem after creating a new CoreData model version and immediately deleting it. The said version didn't appear in Xcode's Project Navigator but was causing the compilation error. I used the "Show in Finder" at one of the model versions and found the .mom file of the deleted model version. Manual deletion solved it for me.

创建新的CoreData模型版本并立即删除它后,我遇到了这个问题。该版本没有出现在Xcode的Project Navigator中,但导致了编译错误。我在其中一个模型版本中使用了“Show in Finder”,找到了已删除模型版本的.mom文件。手动删除为我解决了它。

#2


14  

I have faced the same issue (Xcode version - 6.1.1). For me the following 2 steps helped:

我遇到了同样的问题(Xcode版本 - 6.1.1)。对我来说,以下两个步骤有帮助:

  • I deleted extra model versions by using the "Show in Finder" option for .xcdatamodel file
  • 我使用.xcdatamodel文件中的“在Finder中显示”选项删除了额外的模型版本
  • I removed a reference to an .xcdatamodel file and added it again
  • 我删除了对.xcdatamodel文件的引用并再次添加

#3


4  

I had the same error, in my instance this was caused by us accidentally having the xcdatamodelid file referenced twice in Targets->Build Phases->Compile sources Simply deleting one of the duplicate entries fixed it.

我有同样的错误,在我的实例中这是由于我们意外地在目标 - >构建阶段 - >编译源中引用两次xcdatamodelid文件引起的只是删除其中一个重复的条目修复它。

This may not have been what caused your issue, but it had me stumped for a couple of days so worth checking if anyone else gets stuck on the same problem again.

这可能不是导致你的问题的原因,但它让我难倒了几天,所以值得检查是否有其他人再次遇到同样的问题。

#4


2  

This issue occurs, because .xcdatamodel looses it's reference many times.

出现此问题,因为.xcdatamodel多次丢失它的引用。

So to resolve this, delete the reference of your .xcdatamodel, and then add it again in your project.

因此,要解决此问题,请删除.xcdatamodel的引用,然后在项目中再次添加它。

#5


1  

You could try to edit and re-save your data model in Xcode5.

您可以尝试在Xcode5中编辑和重新保存数据模型。

Also, try to find out why the error mentions "Debug" in the build path when you are actually archiving. Quite possibly your project file has been updated by the Beta Xcode, so you may need to look through your target settings for anything suspicious.

此外,尝试找出在实际存档时错误在构建路径中提到“Debug”的原因。很可能您的项目文件已由Beta Xcode更新,因此您可能需要查看目标设置以查找可疑内容。

In the future when using Beta software, you should always use the most up-to-date one, Beta6 as of today in this case.

在将来使用Beta软件时,在这种情况下,您应该始终使用最新版本的Beta6。

#1


51  

I had this problem after creating a new CoreData model version and immediately deleting it. The said version didn't appear in Xcode's Project Navigator but was causing the compilation error. I used the "Show in Finder" at one of the model versions and found the .mom file of the deleted model version. Manual deletion solved it for me.

创建新的CoreData模型版本并立即删除它后,我遇到了这个问题。该版本没有出现在Xcode的Project Navigator中,但导致了编译错误。我在其中一个模型版本中使用了“Show in Finder”,找到了已删除模型版本的.mom文件。手动删除为我解决了它。

#2


14  

I have faced the same issue (Xcode version - 6.1.1). For me the following 2 steps helped:

我遇到了同样的问题(Xcode版本 - 6.1.1)。对我来说,以下两个步骤有帮助:

  • I deleted extra model versions by using the "Show in Finder" option for .xcdatamodel file
  • 我使用.xcdatamodel文件中的“在Finder中显示”选项删除了额外的模型版本
  • I removed a reference to an .xcdatamodel file and added it again
  • 我删除了对.xcdatamodel文件的引用并再次添加

#3


4  

I had the same error, in my instance this was caused by us accidentally having the xcdatamodelid file referenced twice in Targets->Build Phases->Compile sources Simply deleting one of the duplicate entries fixed it.

我有同样的错误,在我的实例中这是由于我们意外地在目标 - >构建阶段 - >编译源中引用两次xcdatamodelid文件引起的只是删除其中一个重复的条目修复它。

This may not have been what caused your issue, but it had me stumped for a couple of days so worth checking if anyone else gets stuck on the same problem again.

这可能不是导致你的问题的原因,但它让我难倒了几天,所以值得检查是否有其他人再次遇到同样的问题。

#4


2  

This issue occurs, because .xcdatamodel looses it's reference many times.

出现此问题,因为.xcdatamodel多次丢失它的引用。

So to resolve this, delete the reference of your .xcdatamodel, and then add it again in your project.

因此,要解决此问题,请删除.xcdatamodel的引用,然后在项目中再次添加它。

#5


1  

You could try to edit and re-save your data model in Xcode5.

您可以尝试在Xcode5中编辑和重新保存数据模型。

Also, try to find out why the error mentions "Debug" in the build path when you are actually archiving. Quite possibly your project file has been updated by the Beta Xcode, so you may need to look through your target settings for anything suspicious.

此外,尝试找出在实际存档时错误在构建路径中提到“Debug”的原因。很可能您的项目文件已由Beta Xcode更新,因此您可能需要查看目标设置以查找可疑内容。

In the future when using Beta software, you should always use the most up-to-date one, Beta6 as of today in this case.

在将来使用Beta软件时,在这种情况下,您应该始终使用最新版本的Beta6。