Reputation: 7118
I have an xcode project which crashes xcode every time it's opened.
Xcode says "Scanning Classes | Processes 0 of 292 files" at the top continuously and eventually crashes, particularly when I open an .xib files. This happens on multiple computers.
Does anyone have idea what could cause this problem?
Upvotes: 2
Views: 1297
Reputation: 922
thanks for posting about this. had persistent problems with this ourselves. now fixed, in our case it was an implementation file that had somehow ended up in a en.lproj folder that was part of a static library. no idea how that came to be, but now corrected and all is scanning away happily...
conclusion; indexing is very fragile (as if you didn't know that already...)
EDIT: slight correction; i was wrong, my problem was also caused by the same kind of incorrectly terminated comment. had to find this by trial and error, but is now all good. GCC doesn't have an unterminated comment warning flag, unless i'm mistaken? incidentally, this would seem to reveal that the way xcode indexes headers is by concatenating the whole lot into one single file and then processing that. surely a flawed approach?
Upvotes: 0
Reputation: 5369
Today I had a similar problem. Xcode 4.2.1 seemed stuck at "Scanning Classes". It would crash, or if not, it would still not be able to edit .xib files and connect outlets to objects.
In my case, it was a header with an unterminated comment in my source tree that triggered this Xcode bug. That header was inside a folder in my source tree, but was not actually included in my project. (If it had been, the unterminated comment would have caused a compile warning.) Nor was it #import
ed or #include
d anywhere. Just existing in the same folder as headers that were used was enough to rended Xcode unable to edit .xib files.
Anyway in the course of figuring it out and filing a bug with Apple (rdar://10698256), I created a bug reproduction demo project: https://github.com/masonmark/XcodeXibEditBugDemoApp
(I also preserved for posterity all of my own comments in the thread I started on Apple's private developer forum, since Apple's forums are not googleable. It's probably way more information than you need if you have already read the above, but those are at: http://masonmark.com/more-xcode4-fuckery/)
Upvotes: 3
Reputation: 7118
The issue was caused by a mal-formed header file which xcode was getting stuck on. Removing/fixing the file fixed the problem.
I couldn't find anything to point directly to the problem, but going through commits I was able to find it.
Upvotes: 1