Xcode crashes on opening xib files - iphone

I have problems with xcode and can't open xib files. Everytime I click on the xib file, xcode crashes. This happens on the xcode3.2 as well as the xcode4.
Is there anything I can do to it? I have un-installed and re-installed but still not working.
Any help would really be appreciable.
If it helps, I am using xcode4 and bought it from the app store.

My problem was custom fonts in XIB file. I had to install missing fonts on my computer and problem was solved.

The solution to this problem was to re-install my operating system. Basically, I had to re-install Lion and after that everything worked fine. I think the problem had something to do with some library files that were missing.
NOTE: If you have this problem then re-installing your OS might not be the only solution as easier solutions may present themselves. Some of the answers on this question could be of help and in other cases, a simple google or stackoverflow search could be of great aid. You could also try the Xcode mailing list. I would advice resorting to re-installing your OS only if you have tried 'everything' and no one is able to help, hence your plan-Z.

I had this same problem in Xcode 4.3 today. It is definitely a bug in Xcode and it has something to do with opening xib files saved with older versions of Xcode. To work around it, I did the following, some of which may not be necessary, but I'll list it all here just in case:
quit Xcode
copied my xib file foo.xib to foo2.xib
svn rm foo.xib
svn commit
svn update (now foo.xib is not on disk)
open my xcode project, foo.xib shows up in red since it can't find the file. delete foo.xib from the project.
drag foo2.xib from the finder into my project
click on foo2.xib -- for me it opened just fine
At this point I'm pretty sure it's either a subversion conflict with xcode or xcode is keeping a stale reference to a filename around. But now that I have the file open, I do the following:
Show the right-hand-side IDE settings pane (where you can set NIB options).
Click the top left icon in the right-pane (tooltip says "Show the File Inspector").
There is a section called "Interface Builder Document" and under there is a "Document Versioning" popup/combo box. My file shows Xcode 4.2.1, so I changed it to Xcode 4.3.
At this point I also fiddled with a few other settings in my nib, for example changing the title of a Window. The point of this was to make sure the nib would be re-saved.
Now in the left-hand pane that lists the project files, I clicked on "foo2.xib" and renamed it to "foo.xib" -- Xcode automatically adds it back to the subversion repository.
And everything just magically worked after that.
I will point out that I went through and changed all of my nib files after that to save as "Xcode 4.3" under the Document Versioning pane.
I sent a crash report and the nib contents to apple in a bug report but if anyone wants to see what actually happened I pasted it here:
http://pastebin.com/sC0pBUfu
I hope this helps someone, it took me about four hours to sort this out. Recreating nib files doesn't work, its a problem with the filename and IDE-version saved into the nib file I suspect.

Just Install one xcode at a time. Means use Xcode 4 or Xcode 3.2 alone. This may solve your problem. Try that.

Edited with new suggestion from http://www.cocoabuilder.com/archive/xcode/305032-xcode-help.html :
If you have entirely uninstalled and then reinstalled XCode, and by
uninstalled I mean running
sudo /Developer/Library/uninstall-devtools -mode=all
and then trashing /Developer and then reinstalled and it's STILL not
working then from the error I have to think you have a corrupted OSX
or a stray library.
I googled and found a couple of people who succeeded by reinstalled
SnowLeopard (and then upgrading it all the way to latest patch level,
then reinstalling XCode), and there were a few people who had found
stray libraries in /usr/local/include and /usr/local/lib, so you might
want to go look for odd files there, or perhaps TEMPORARILY rename
them and try reinstalling XCode, I'm not sure how much of what's in
there you really need. The particular post I found they guy had
installed ImageMagic and he had removed those libraries from
/usr/local/lib and was working again.
At this point I'd be looking beyond XCode itself and assuming my
system was corrupt.
There's more suggestions on Google, just put in CFXMLNodeGetInfoPtr
and there are loads of posts, more asking than answering.
and Don't use the App Store version. Use the one on Apple.com/Developer for iOS SDK's.
Create a new XIB. Click once. If not:
Don't just open the xib, right click Open As : Source. See if you can see anything, if it still crashes:
Does not seem to a Xcode.pbxproject error

Well, one way can be..:
type interface builder in spotlight
open it.
go to your project and drag & drop your xib to the interface builder on the dock.
It will open.
This problem may be because of multiple versions of xcode on different locations on your mac.

Can't open any xib file for iOS? In your crash log,
Details: Interface Builder encountered an error communicating with the iOS Simulator. "Interface Builder Cocoa Touch Tool" (5963) failed to launch and exited with status (null), signal 5. Please check Console.app for crash reports for "Interface Builder Cocoa Touch Tool" for further information.
Have you checked your console log using Console.app? Anyway, it sounds like that your Xcode environment is corrupted.
sudo /Developer/Library/uninstall-devtools -mode=all
If you put any files into /Developer, back it up.
sudo rm -rf /Developer
reboot.
install Xcode.

Its an XCode bug.
Creating a new .storyboard and opening it before opening .xib will fix the crash, at least temporarily.

Related

Finished running <App> on iPhone 6.1 Simulator

I'm developing a new application for Iphone, using Xcode (Version 4.6 (4H127)) and the iPhone 6.1 simulator (VersiĆ³n 6.0 (369.2)).
At the beginning everything was great: every time I pressed the "run" button, the application was loaded into the simulator and I was able to test it. But sometimes it is not working: when I press the run button, I only get the message "Finished running on iPhone 6.1 Simulator". The code successfully compiles (only minor warnings).
The main problem is that when I get this message, the only way I can use the simulator again (in this project, the rest of the xcode projects seems to work properly) is by starting a new project and adding every file to it.
I've tried to delete de derived data, restart de simulator, restart de computer, etc. Even I made a snapshot when the simulator was working, but when I go back to the snapshot state, the simulator still don't work.
What can I do? Any idea?
1.Manually launch the iOS Simulator.
2.From the "iOS Simulator" menu, click "Reset content and settings",
3.Close and rebuild your app.
This problem may arise when you have problems with your project's plist's target membership. Select your info plist file from project navigator folder structure's Supporting Files, go to interface builder pane(Utilities Section under View in Top Bar), then look for Target Membership in File Inspector pane, if it is checked, uncheck it. Clean & Build, Hope it helps.
Library > Application Support > iPhone Simulator > 6.1 (or whichever you're using) > Applications > Your Application and delete it.
Rebuild your app and relaunch.
I had the same problem, with the same "failed to attach to process ID 0" (I actually didn't notice that error until I saw that you said you had that error). In one of my projects the 6.0 simulator didn't work, but works in my other projects. Also my 5.1 simulator worked.
What worked for me was based off this other answer for a similar question: https://stackoverflow.com/a/12423912/159758
Go to the Product menu and find the Edit Scheme menu there.
While in Edit Scheme window, select the "Run" option on the left hand side of the screen and then on the right hand side, change the debugger from LLDB to GDB.
Run the project, this worked in the simulator.
Then Go back to the Edit Scheme and set back to LLDB.
I noticed you've tried setting the debugger to GDB and not a debugger, but thought I'd mention what helped me, since you're question helped me get to the bottom of my problem (i.e. seeing the "failed to attach to process ID 0" message).
This problem may arise due to presence of more than one info.plist file.
I also faced a similar problem, and eventually found that while adding some resource file from another project I also added its info.plist file.
Once check your Build phases> Copy Bundle Resources, whether another info.plist file exist there or not. If exists then delete it, clean the project and rebuild it.
Hope it helps.....
I ran into the same issue and somehow was able to fix it and almost immediately it went back to being broken. I can tell what broke it though.
I added a couple of folders (folder references) with files in them to the copy bundle resources section. That broke it. If I recall right, I had removed both of those and was messing around with DeploymentTarget. I might have reset the simulator earlier. Regardless, it started working. So,
there is hope for a fix
this thing is caused by folder resources that need to be copied into the bundle
Updated:
I was able to get it working again. Here is what I did..
- Cleared out the derived data folder
- Shut down the simulator app
- Also cleared the deployment in the simulator folders (Users/XXXXXX/Library/Application Support/iPhone simulator/6.1/Applications)
Since last time adding the folders to the bundle caused it to lock up, I tried it step by step adding one folder to the bundle and trying. Turns out one of my folders was named Resources and it dawned on me that particular name could potentially be colliding with something else the app looks for. So I renamed that folder to Res and tried it. It works now.
So there you have it.. Follow the steps above to get out of the problem.
Avoid copying folders called Resources to your bundle.

Xcode keeps crashing when opening a certain project

Xcode crashes as soon as I open the project. What is more interesting is the fact that XCode does not crash on other projects. Any ideas of what this could be ?
Update 1: I am using XCode 4.2 on a Snow Leopard machine.
Update 2: I have a sneaky feeling that the crash is happening only when I click on the project navigator button
Generally when this happens, deleting all the user files from the project will fix the crash.
Delete the following files from your Project.xcodeproj/ directory/bundle:
project.xcworkspace
xcuserdata
The crash appears to have something to do when drawing the SCM status (Git, Subversion) of one of your files. Personally, I don't have this problem, so I can't offer a specific fix. Perhaps there is something atypical about your repository's state which you can correct.
You may also want to try (temporarily) deleting your xcuser state data (shot in the dark).

Xcode 4 archive results in slow/unresponsive Organizer & pngcrush process takes up 100% cpu

sorry about the rather confusing title, but I tried to get in as much info as possible.
Problem:
I'm trying to archive my iPhone app into an ipa file for OTA testing (via TestFlightApp) - so in Xcode, I perform a Project > Archive.
After the archive is successful, it opens the Xcode Organizer to create the ipa file.
BUT as soon as Organizer is opened, Xcode becomes VERY slow & essentially unresponsive.
So naturally I open Activity Monitor to see what's going on and there's a process called "pngcrush" using up almost all my cpu (90%+) and causing Xcode process to be intermittently listed as "not responding". I can't seem to do anything in Organizer because it just keeps throwing the spinner/loading cursor.
Any ideas on how to fix this would be great! Also, I've tried setting "Compress PNG" option in build settings to NO, but problem is still there. Thanks!
Xcode 4.0.2, OSX 10.6.6
Deleting Archives will improve the responsiveness of the organizer. I guess the Organizer runs pngcrush on all archives. Perhaps one should submit this as a bug to Apple.
The Archives are saved in ~/Library/Developer/Xcode/Archives. If you want to keep the archives as backup, move them to another folder. Personally I've created a folder ~/Library/Developer/Xcode/Archives Backup to save old archives in.
This is a weird bug.
I found the way I solved it was by deleting the launch images from the bundle and then adding the images normally, though, the add files interface. If I dragged the images into the summary pane on the application target, it cause the large image to show up in the organizer preview image which PNGCrush is constantly trying to shrink.
I found it by deleting the icon and/or launch image file as well as moving the archives with the offending icon/launch image files. I also found, the launch image file was 20px too small as I trimmed for the status bar which is incorrect. (See: https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/IconsImages/IconsImages.html#//apple_ref/doc/uid/TP40006556-CH14-SW5)
First of all try restarting your computer. Sometimes Xcode can get into a loop that only a restart can solve.
Secondly, have you tried letting it finish? PNGCrush is a process that compresses all the PNGs in your project to save space.
Also, try deleting your workspace file. See here:
Xcode 4 - slow performance
For some reason my Info.plist file had multiple (some invalid) entries for Icon files and Icon files (iOS 5). I removed all the items in these lists, re-added the app icon, and everything seemed to start performing well again. Hope this helps someone else!
#wolfgang's answer was right for me, and in general - clean up Organizer on all its data -
Archives
Devices
Provisioning Profiles
You can find a discussion on Apple support forums: https://discussions.apple.com/thread/3159366?start=0&tstart=0
I got to a point I had to restart the computer if I accidentally opened Organizer. Now I can breathe again.
I solved mine Organizer freeze by:
rm ~/Library/Developer/Xcode/UserData/IDEOrganizerWindowController.xcuserstate

Xcode 4 not launching application?

Today, after installing Xcode 4 with the 4.3 SDK, I attempted to launch my application. However, the application will build and the iOS Simulator will pop up, but I get a message in the window in Xcode that says "Attaching to YourApp" which stays there indefinitely. How can this problem be fixed?
I had the same problem, that is, when I launched my application in the simulator, Xcode was hung waiting for the simulator to start. The simulator showed a black screen - nothing at all.
Note this is a project that ran fine on Xcode 3 and is the exact set of files used to build the application that is currently for sale at the App Store.
Okay, so here's the underlying problem, and my solution:
My application name was "ultimateTimer.app", as seen in Xcode under the Products folder. However, this was NOT the name in the project file.
Here's how to found out:
Click on your project in Xcode (it's usually at the top, e.g. mine is called ultimateTimer.xcodeproj). Under "Build Settings" tab, look for the "Packaging" area and specifically for the "Product Name" variable. Under Product Name, I had three entries:
Debug
Distribution
Release
Under Debug, it had the value "TalkUltimateTimer" which was an old name of mine. When I changed this to "ultimateTimer" to match the "ultimateTimer.app" as above, I found the Xcode attached to the simulator correctly.
This happened for me for iPhone applications. I opened the simulator myself and switched the device to iPhone Retina Display and from then on it worked. I tried switching back, but it didn't work again, so I have had to keep it on the Retina Display simulator, and if I need to test non-Retina Display I'll use the iPad simulator.
I skimmed the post and these seem to be the two solutions thus far:
I think I figured out the problem:
I went to 'Edit Schemes', and for some reason, the scheme I was using was pointing at BumpDev.app as the executable instead of bumpdev.app. Changing this made things work. Perhaps there is an issue when converting from xc3 proj files?
Anyways, the app now boots in the simulator. Yay!
And the other solution in that post is:
Did your project by any chance have a folder reference with images in it?
For me the problem only happens when I have a folder reference in the project. When I remove the folder reference and instead add the folder as a group, clean the project, and hit launch things work fine. In the "Copy to Bundle" phase each image is then listed individually, whereas when I had a folder reference, the whole folder was listed.
This took me a really long time to figure out. It was quite frustrating, but I'm glad I have a workaround until the bug is fixed.
I had the same problem after swapping the mouse for a new one. restarting my iMac resolved the issue.
I just upgraded to Xcode 4.3.2 and had the same issue with new projects. After poking around and comparing projects, I found out that new projects were set to the LLDB dbugger and the projects that worked were using GDB.
After changing the debugger for the new project to GDB, it worked. I am yet to research what the differences are, but at least I can now run my new projects.
Ensure you are starting a proper scheme.
I. e. when using CocoaPods, running Pods scheme would not start emulator.
It's a known issue. Have a look at this thread in the official forum.
Hey, update Xcode to 4.0.2. Problem solved :)
I had the same problem, I tried every solution here, but no works. Finally, after I rebooted my computer, the problem was gone.
Restarting the simulator worked for me

Xcode 3.1.3 breaks console output

Today has been a headache - first my upgrade to xcode 3.1.3 trashed all my certs/provisions. After two attempts, I got them fixed.
Now, I'm dealing with the issue in the subject, no console output.
Absolutlely nothing is getting printed to the console - No startup info, not when I "print" a variable from xcode when stopped on a breakpoint,
not NSLog() either.
Nothing.
I've restarted my Mac, restarted Xcode, etc. I've made it so clears the console and opens it on project build. I had GDB log to a file,
and that works, so the plumbing is cool. Its just the console itself is dead.
Image: (and this is after attempting to print the contents of a variable while the app is running)
http://mr-sk.com/iphone/screen-capture-2.png
It doesn't seem to matter if I'm on the device or the simulator ...
That looks like the split bar is pinned all the way to the right side. Look for the dimple and drag it back toward the right.
I'd also try asking in the iPhone developers portal forum, since you can ask about beta versions of stuff there...
This is an older post, but I just recently ran into this with 3.2.3, so if someone happens upon this the answer by cdespinosa was spot on, however many of us "noobs" may not know exactly where to find those files, so just in case...
Go to Finder, find the folder where you have your .xcodeproject file and right click on it and click on show contents of this package. When the new window appears, move the .perspective, .mode, .pbxuser files to trash. (Make sure XCode is closed when you do this...I happened to do this while the project was open like an idiot and didn't think it worked the first time)
Now reopen xcode and your project. Your console should now be fixed.