打开项目文件时 Xcode 崩溃 [英] Xcode Crashing When Opening Project File
问题描述
当我打开我的项目文件时,Xcode 不断崩溃.我已经能够打开它好几个星期了.不知道如何诊断.它只针对特定项目崩溃.
Xcode keeps crashing on me when I open my project file. I've been able to open it fine for weeks now. Not sure how to diagnose. It only crashes for a specific project.
Process: Xcode [1293]
Path: /Developer/Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.Xcode
Version: 3.2.5 (1760)
Build Info: DevToolsIDE-17600000~5
Code Type: X86-64 (Native)
Parent Process: launchd [189]
Date/Time: 2010-12-15 16:05:24.659 -0700
OS Version: Mac OS X 10.6.5 (10H574)
Report Version: 6
Interval Since Last Report: 201 sec
Crashes Since Last Report: 4
Per-App Interval Since Last Report: 80 sec
Per-App Crashes Since Last Report: 4
Anonymous UUID: 2B7F7CFC-45EA-450C-8467-6BF1E356B6F6
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000025940
Crashed Thread: 10 Dispatch queue: com.apple.Xcode.index-access
Application Specific Information:
objc[1293]: garbage collection is ON
推荐答案
崩溃通常是项目文件已损坏的迹象.下面列出了您可以尝试解决的问题.
The crash is generally a sign the project file has been corrupted. Here's a list of possible things you can do to try to fix it.
如果您使用的是版本控制,则可能是由尚未解决的合并冲突引起的.
If you are using version control, it might be caused by a merge conflict that has not yet been resolved.
- 使用 Finder,打开项目所在的目录.
- 右键单击项目文件
YOUR_PROJECT_NAME.xcodeproj
和Open With
您首选的文本编辑工具,例如 Sublime Text. - 查找通常使用一系列
=========
条标记的合并冲突. - 手动解决合并冲突或删除一侧的更改.
- Using Finder, open the directory that holds your project.
- Right click the project file
YOUR_PROJECT_NAME.xcodeproj
andOpen With
your preferred text editing tool such as Sublime Text. - Look for merge conflicts which are usually marked using a series of
=========
bars. - Resolve the merge conflicts manually or remove the changes of one side.
由不可读的 XML 引起
如果失败,请进入文件并快速滚动查看是否有任何不合适的地方 - 它通常应该是可读的 XML.您甚至可以尝试使用 XML 验证器来检查是否发现任何问题.
Caused by unreadable XML
If that fails go into the file and quickly scroll through to see if anything seems out of place - it should generally be readable XML. You could even try an XML validator against it to see if anything amiss was found.
- 使用 Finder,打开您的项目所在的目录.
- 右击项目文件
MyProject.xcodeproj
并选择Show Package Contents
. - 删除
xcuserdata
文件夹,该文件夹应包含一个包含您的用户名的文件夹. - 为您的工作区文件
MyProject.workspace
重复第 2 步和第 3 步
- Using Finder, open the directory that holds yor project.
- Right click the project file
MyProject.xcodeproj
and chooseShow Package Contents
. - Delete the
xcuserdata
folder, which should contain a folder with your username on it. - Repeats step 2 and 3 for your workspace file
MyProject.workspace
正如 KennyWinker 和 Paul R 关于下面的答案.
As elaborated by KennyWinker and Paul R on the answers below.
请注意,这应该是您最后的手段,因为对于大型项目来说这样做非常乏味.
最后,您可以简单地重新创建它.这可能看起来很痛苦,但基本上您可以创建一个新项目并将Classes"文件夹下的所有内容拖到 Xcode 中以开始使用它(不要忘记同时添加您需要的框架).
Lastly you could simply re-create it. That might seem like a big pain, but basically you could just create a new project and drag everything under the "Classes" folder into Xcode to start using it (don't forget to also add the frameworks you need).
这篇关于打开项目文件时 Xcode 崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!