xcode won't compile iOS apps, crashes when .xib or .storyboard files are opened - iphone

I'm running the very latest version of xcode (4.2.1). And I'm signed up to the ios developer program.
When I create a new iOS Application for iPhone or iPad, using storyboards or not it doesn't seem to matter, xcode crashes on me when I try to open the .xib or .storyboard files.
Here is the error provided when I click on the storyboard file before it crashes.
ASSERTION FAILURE in /SourceCache/IDEInterfaceBuilderCocoaTouch/IDEInterfaceBuilderCocoaTouch-933/IB Plugin/Utilities/IBObjectMarshalling.m:179
Details: Interface Builder encountered an error communicating with the iOS Simulator. "Interface Builder Cocoa Touch Tool" (54332) failed to launch and exited with status (null), signal 10. Please check Console.app for crash reports for "Interface Builder Cocoa Touch Tool" for further information.
Function: NSDistantObject<IBCocoaTouchToolProtocol> *IBAttachToCocoaTouchTool(IBCocoaTouchTargetRuntime *)
Thread: <NSThread: 0x40010a260>{name = (null), num = 1}
Something to do with the iOS simulator? Exactly the same message appears when I try open an .xib file.
When I try to run or test a project I get an error when it tries to compile the storyboard or xib files. eg
CompileXIB EmptyViewTest/en.lproj/com_markstewart_comViewController.xib
cd /Users/mark/Sites/_iOS/EmptyViewTest/EmptyViewTest
setenv IBC_MINIMUM_COMPATIBILITY_VERSION 5.0
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr /bin:/usr/bin:/bin:/usr/sbin:/sbin"
setenv XCODE_DEVELOPER_USR_PATH /Developer/usr/bin/..
/Developer/usr/bin/ibtool --errors --warnings --notices --output-format human-readable-text --compile /Users/mark/Library/Developer/Xcode/DerivedData/EmptyViewTest-dxxqhrayajehooezj flgyjqysqkp/Build/Products/Debug-iphonesimulator/EmptyViewTest.app/en.lproj/com_ markstewart_comViewController.nib /Users/mark/Sites/_iOS/EmptyViewTest/EmptyViewTest/EmptyViewTest/en.lproj/com_m arkstewart_comViewController.xib --sdk /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0 .sdk
Please help! How do I get this to work again?
I've since totally uninstalled and re-installed developer tools. Same problem still occurs. It seems to be something to do with the iphone simulator as when I try to run the simulator app by itself it instantly crashes too. (see attached screenshot). What is going on?! :(
----- UPDATE 2
Still having this problem! I can sometimes build applications, but as soon as I click on either the .xib or .storyboard file (in separate projects) xcode crashes. When they do succeed I get the error above that the simulator has issues locating the SDK.
I've uninstalled and reinstalled xcode about five times now and the same issues keeps occurring.
Here is the crash report from the "Interface Builder Cocoa Touch Tool" error. If it makes sense to anyone? Crash Report
Does anyone have any other ideas? Starting to get pretty desperate.

did you installed TotalFinder?
I had the same problem caused by TotalFinder's Asepsis feature.
Asepsis current Version (1.1) Conflicts with Xcode 4.2 and Glims (see image).
The Website lists this known issue:
Xcode 4.2, iOS 5.0 Simulator
Some developers reported that Asepsis breaks iOS 5.0 Simulator and
causes Xcode 4.2 fail in loading XIB files
to uninstall just run this command from Terminal:
sudo open /System/Library/Extensions/Asepsis.kext/Contents/Resources/Asepsis\ Uninstaller.app

I had this same problem and deleting everything in your "Derived Data" folder fixed my issues. In your case: /Users/mark/Library/Developer/Xcode/DerivedData/EmptyViewTest
Maybe this thread will help:
How can I safely delete in my ~/Library/Developer/Xcode/DerivedData directory?

It's a pretty fundamental problem and so unlikely it's anything you're doing wrong. I'd suggest reinstalling Xcode. If that doesn't work, try uninstalling it first and install it again. (Bit of a pain, sorry. Stock up on coffee first.)

I hate to say it, but it sounds like you may need to do a clean system install followed by a clean XCode install.
Or do you have another machine you can try a clean install of XCode on first?
If you can't just create a new project and run it in the simulator without it crashing you either have an issue with XCode or with your system. Since reinstalling XCode you still have an issue, I am afraid that leaves your system in question.

Try removing (you can try just moving them rather than deleting them) these user directories. Make sure your developer tools are not running when you do this.
~/Library/Application\ Support/iPhone\ Simulator
~/Library/Application\ Support/Developer
~/Library/Developer
These directories are particular to your user.

I have same problem within xcode4.5 and iOS6. When I startup iOS simulator 6, it always report "The simulated application quit" and ask me to switch SDKS. Whatever I choose the right location of SDK5.0 or SDK6.0 for the simulator, the problem is still here. So I can't run even a simplest program with SDK6.0, but the old projects with SDK5.0 are ok.
I don't why, because it works well before today. So I follow #quellish's way, close xcode and simulator, remove these directory in my finder:
~/Library/Application\ Support/iPhone\ Simulator
~/Library/Application\ Support/Developer
~/Library/Developer
Then run Xcode again, everything goes ok again! thanks quellish!
I think some files in these directory was broken, so the strange problem happened. If someone know exactly why it happened, it's appreciate you can tell me.

Related

Error launching remote program: No such file or directory

Anyone have an idea about this
Error launching remote program: No such file or directory (/Users/muself/Library/Developer/Xcode/DerivedData/myproject-hlelojuljidnnagbdqzliazpdgmn/Build/Products/Debug-iphoneos/myproject.app/myproject).
The project was working fine with the previous Xcode versions. I have just updated the Xcode to Version 4.3.2 (4E2002), & the error start coming.
I have search on the web, and tried a lot of the options like
Quit Xcode, clear the Derived Data folder, restart the Xcode.
Rename the project,
Reset the device,etc
I also tried this on another machine but did not work, the same problem occurs.
But one thing i have some other projects as well and they are working fine.
Thanks for at least reading this.
First try restarting Xcode. If it doesn't work, then try hard reset of your device. This happens to me when I change the bundle identifier of my app.
This solution,I found of the above problem its working fine for me.:)
have you tried to "validate settings" (button on the bottom of project settings)? Do you use some static libs in your app? – Vov4yk
Check your deployment target. I am running Xcode 4.5, and it gave me that cryptic message, while the reason was that my iPad is running version 5.1.1, and my app was set with deployment target of 6.0.
I also get same problem. This below solution works for me.
Thats really annoying. This error happens in a number of different situations. Sometime restarting the Xcode, fixes the problem. If not, follow these steps:
Disconnect your device.
Delete the app from your device.
Quit xcode (Don't just simply close the window, quit it)
Delete derived data folder (~/Library/Developer/Xcode/DerivedData/APPNAME -gbrvhlvwmpiobxdujegtghggrffp - or something like that)
Now start Xcode, connect device and run the project. It should work fine.
Source: http://dhilipsiva.com/2012/07/24/xcode-could-not-launch-app-no-such-file-or-directory-error.html
Hard reset of the device fixed it for me. i.e. power off and back on.
Quitting Xcode, disconnecting, reconnecting the device etc didn't.
The error occurred just after I had created a new project with the a duplicate Bundle Identifier to another. Both apps coexist OK on the device/ in Xcode, but this does seem to cause the above issue.
I saw this when I let the build configuration set up as ad-hoc. After I put it back to Debug it worked fine.

Error : failed to launch, when running on ipad

After much frustration I've finally got an application to run on an iPad without errors. However it doesn't run. It gives the following error. My application does run on the simulator but doesn't run on an iPad and gives the below error. I'm really not sure why. I went to the described folder the structure of the folder is as follows.
Products
.DS_Store
Debug-iphoneos
.DS_Store
sampleproject.app
sampleproject.app.dSYM
Debug-iphonesimulator
.DS_Store
sampleproject.app
sampleproject.app.dSYM
error: failed to launch '/Users/x/Library/Developer/Xcode/DerivedData/sampleproject/Build/Products/Debug-iphoneos/sampleproject.app/myProject' -- No such file or directory (/Users/x/Library/Developer/Xcode/DerivedData/sampleproject/Build/Products/Debug-iphoneos/sampleproject.app/myProject)
Just had the same error on Xcode 4.3.2, with target iPad3 5.1, but was able to build and run on my device after these steps:
Deleted my DerivedData directory (emptied trash too)
Quit XCode
Disconnected iPad USB
Rebooted Mac
Rebooted iPad (power down and back up)
Reconnected iPad USB.
Restarted Xcode with project
Confirmed build for debug on device selected.
Clicked Run
I've no idea whether all these steps are mandatory. This is a crummy answer, since it neither explains the problem, nor offers a sure fix. I expect better of Apple; I've looked for a better answer, but found nothing.
Rebooting to solve problems is no solution! OTOH, it let me proceed on with my work, so...a small blessing.
Deleting the DerivedData directory and restarting Xcode worked for me. Simple restart of xcode did not.
Following Tarryn's suggestion to delete DerriveData leads to another problem "No Code Sign found", which brings my attention to the Code Sign section in my Build Setting. The Code Sign for Debug is set to "Don't Allow". Changing it back to my iOS developer profile solves the issue.
If anyone gets this problem and follow the path Tarryn suggested, there is one more step you can try to work this out.
Very frustrating, but in the end a simple exit XCode and restart XCode seemed to clear the issue.
Firstly quite the Xcode and restart, it'll run finely..
restarting the Mac fixes for me.
under /DerivedData: rm -r sampleproject
-> disconnect ipad -> reboot ipad -> reconnect ipad
-> quit & relaunch XCode
it worked for me, hope it helps!!!
Restart Xcode and it works again.
Another cause of this problem
Selecting the wrong mobileprovisioning profile. For example you can have a Distribution profile selected in Debug mode, Xcode will then not allow the app to start in debug mode.
To fix this
Select your project file in Xcode
Choose "Build Settings"
Search for "code signing"
Confirm that a Development profile is selected for "Develop" builds
It sounds like the target is not necessarily set up correctly. What is the name of the Target? I see "Virgin Atlantic" there, but the project root is "sample project"?
It happened to me using Xcode 7.1.1 with OSX Yosemite.
Followed all steps of #tarryn (the accepted answer) but did not restart my mac. Restarting the mac eventually solved the problem for me.
Disconnecting the iPad and reconnecting it just worked for me.

Error in Xcode getting debugging info from 5.0.1 iphone

I´ve found a strange issue with latest XCode 4.2 when trying to deploy my app to an iphone that just upgraded to 5.0.1.
It starts copying the debug info and the progress moves until the end, although it does not move beyond 'copying file 2 of 9'.
After it's done I get the message:
Xcode has encountered an unexpected error (0xC002)
No such file or directory, at ‘/SourceCache/DTDeviceKit/DTDeviceKit-867/DTDeviceKit/DTDeviceKit_Utilities.m:864’
in the organizer window. Any similar experience and clue on how to get over it?
Needless to say every party involved has been restarted dutifully, including myself.
Thanks for all your help
I found the following post helpful, although it is kind of dated:
https://stackoverflow.com/a/9944892/1031623
The only thing that I had to change is the following:
Close Xcode
Go to: "~/Library/Developer/Xcode/iOS DeviceSupport/5.0.1(9A405)/Symbols/System/Library/Caches/com.apple.dyld/"
Note: if you
don't have this folder, run Xcode, connect your device, and wait
until the error 0xC002 appears in Organizer - the folder should be
created by that time.
Create 3 empty files there called:
.copied_dyld_shared_cache_armv7 <== not 6
.processed_dyld_shared_cache_armv7 <== not 6
dyld_shared_cache_armv7 <== not 6
Run Xcode and enjoy the light next to your device eventually go
green:)
I have found a potential fix. I tracked the issue down to some files not copying into the ~/Library/Developer/XCode/iOS DeviceSupport/5.0.1(9A405)/ folder. I borrowed a friend's iPad with the 5.0.1 update, and attempted to use his device for development. It worked fine, and I noticed my iOS DeviceSupport/5.0.1(9A405) folder suddenly had many, many more files. I then connected my problematic iPad and bam, it just worked.
I attempted restoring, recovering, etc. and I could not fix the issue with these methods. I did the OTA update, and so did my friend, so our iPads were updated in exactly the same way. I do not have any explanation of the issue, but at least I have found a workaround.
If you don't have access to another device with the files, here's a zip file of them:
http://www.enemyhideout.com/ios/5.0.1%20(9A405).zip
Delete the ~/Library/Developer/XCode/iOS DeviceSupport/5.0.1(9A405)/ folder.
Then connect your device and go to the Organizer.
Xcode should recreate that folder and fill it up with informations from your device.
Thank you #Chris Hill, I was running into this on Xcode 4.3.1, but instead of
.../DTDeviceKit-867/... I was getting .../DTDeviceKit-1197/...
At first I replaced all the files mv -f ~/library/... and started up Xcode again, I deleted all the files I placed there from your pkg, So I tried with Xcode open, iPhone plugged in; and it worked perfect!
Thanks again

Issue with iphone sdk 4.2.1

Probably a silly question. When running my project on the Device in the debug mode I get a lot of warnings al having the following string:
warning: Unable to read symbols for
/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1
(8C148a)/Symbols/System/Library/PrivateFrameworks/
I think its due to the space between "4.2.1" and "(8C148a)". How can i get rid of it? It must be a setting somewhere in Xcode.
I dont have these warnings on the simulator.
thanks in advance, Christian
I was getting:
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/info/dns.so (file not found).
Version 4.2.1 does not include 'info/dns.so'. At least that was the case for me. However, it does exist in the 4.2 directory and is pointed to by the /DeviceSupport/Latest shortcut. I simply copy-pasted 'info/dns.so' to where the debugger was looking for it and that seemed to fix the warning.
I had this issue with 4.2.1 (8C148a), which I believe is caused by differing DeviceSupport files on the phone and in XCode. I tried many things, but eventually resolved it by deleting this folder:
/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148a)/
After this I plugged in my iOS device and was asked to connect and restore the symbol files from the device, and it worked normally again.
When you plug an iOS device (iPad) with a slightly newer OS than the the ones in the SDK, a button to download new symbols should appear in the Organizer window of Xcode. Hit it and wait.
I've seen errors like that when my device wasn't on the same version as what I was building for. Are you sure you're not on a 4.2 beta?
I don't think 8C148a is "final"; final builds numbers never seem to end in a letter (my phone is reporting "4.2.1 (8C148)"). I haven't debugged apps on it yet (I got bored waiting for it to extract symbols and went home).
4.2 GM was 8C134, so you're certainly running newer software, but something somewhere is getting the build number wrong.
But I digress.
What directories are in /Developer/Platforms/iPhoneOS.platform/DeviceSupport? If "4.2.1 (8C148a)" doesn't exist but "4.2.1" does, you might have luck doing something like this in Terminal:
cd /Developer/Platforms/iPhoneOS.platform/DeviceSupport
ln -s "4.2.1" "4.2.1 (8C134a)"
Equivalently, if "4.2.1 (8C148)" exists, do something like this instead:
ln -s "4.2.1 (8C148)" "4.2.1 (8C148a)"
You can generally use this trick to get Xcode to talk to a beta device without installing a beta SDK; this is useful if your company has some people running the beta (for testing purposes) and other people on the latest "final" (for release purposes).
There's a mismatch at the moment, where the released version of 4.2.1 is ahead of the SDK version 4.2
#Khrob's comment fixed it for me though!
Until they provide a solid SDK, a cool workaround is to :
1 - select the Executable ( In 'Executables' in the project browser ),
2 - get info and turn off "Break on Debugger() and DebugStr()"*
Cheers, and best wishes for 2011.
T
This does not disable NSLog.
I have 4.2.1 on an iPhone 3G and Xcode 3.2.5 running on a MacBook Pro with 10.6.6. After a clean install of Xcode, I was getting the prompt to download symbols for 4.2.1 after plugging in my iPhone. After the transfer, I would no longer get the prompt when attaching the iPhone, but I was getting tons of "unable to read symbols" messages.
First, what did not work for me:
Creating symbolic link to '4.2 (8C134)' with the name '4.2.1 (8C148)'
Creating symbolic link inside directory '4.2.1 (8C148)' like there is in '4.2 (8C134)' to the ../../Developer/SDKs/iPhoneOS4.2.sdk
Both of the above caused the 'UUID mismatch' errors for several libraries. GDB would start but appear to hang.
Finally, what is currently working for me:
% cd /Developer/Platforms/iPhoneOS.platform/DeviceSupport
% mkdir '4.2.1 (8C148)' # if it does not exist
% cd '4.2.1 (8C148)'
% cp ../4.2\ \(8C134\)/DeveloperDiskImage.dmg* .
% cp -r ../../Developer/SDKs/iPhoneOS4.2.sdk Symbols
Attempt to run debug session for an application and watch the Console. For each warning about a UUID mismatch, remove the file indicated in the log message (I had AudioToolbox, CoreMedia, and some others)
Stop GDB and try again, hopefully with success
At least for my application under development, everything now works fine. Hopefully, Xcode 4.0 will clear this up.

iPhone Simulator: SpringBoard failed to launch application with error: 7

Building an iPhone project results in:
Failed to launch simulated application: SpringBoard failed to launch application with error: 7
And the app doesn't install on the simulator. What's this all about? What's SpringBoard and what is error 7?
I had the exact same problem - I reset the iphone simulator and then quit the simulator (i.e. command q) then started it again.
Worked.
Boy, is the answer to this one hard to find, but I came up with a workaround. The simulator gives this error if it has any problems with accessing files in ~/Library/Application Support/iPhone Simulator/. This could be a permissions problem, but in my case it was even more subtle: my home directory is NFS mounted, and that seems to somehow be the source of the problem.
The basic workaround is to create a directory local to the machine, and link the iPhone Simulator's directory to that local directory. You shouldn't need to move your source files or project directory; it's just the simulator targets that are the problem.
Here is one series of steps to accomplish the workaround, to be typed in at the terminal
(1-3 done on every machine you'll be developing on, 4-6 once in your NFS-mounted home directory):
sudo mkdir /usr/local/iphone-dirs
sudo chmod 777 /usr/local/iphone-dirs
mkdir /usr/local/iphone-dirs/my-dir
cd "~/Library/Application Support/"
rm -rf "iPhone Simulator/"
ln -s /usr/local/iphone-dirs/my-dir/ "iPhone Simulator"
There are obviously many variations on this theme; I suspect that using a locally-hosted directory in /tmp would be fine (and not require admin privs, but would have to be redone every time the system is rebooted). As given, steps 1 and 2 are good if you will have multiple users using these machines that you don't want to collide with each other. If you have your own personal machine but NFS-mount your homedir, you could probably just skip to something like step 3 (and sudo it). Just make sure that whatever dir you create in step 3 is the dir that you symlink to in step 6.
No need to quite the simulator or delete the app..
Just select simulator, press command + shift + h + h and remove the app from background process(long press on app icon) then run your app again.
I started with a new project in Xcode and got the error 3 message, but otherwise same deal. New damn project - so no problems with broken code I added or name mistakes or anything else. But the app would build but fail to run in Simulator with the Springboard -3 error code. I've seen this before lots of times, and the basic kill-the-app-in-simulator, clean-and-run would work, but not this time.
Turns out my old 2007 iMac barely has enough RAM and disk space free any more. I'm running Mavericks, and I hid everything but Xcode and the Simulator, then ran a memory cleaning utility to free up every bit of RAM available (got back up to 1GB free or so), and then the app runs in the Simulator without a hitch. No more Springboard error.
I hadn't seen "too little RAM" listed as a reason for this error yet, so this may be useful for somebody else.
Springboard is the app that launches apps. It's the home screen of the iPhone. I had tons of problems when I tried to get my app running on the phone -- turns out that I had an older version of the SDK that was incompatible with the version of the OS my phone had. Reinstalling the latest SDK did the trick.
Also, have heard that clearing the XCode cache sometimes helps (didn't for me) -- XCode menu->Clear cache...
Maybe this will help: http://discussions.apple.com/thread.jspa?threadID=1605042&tstart=72
I had similar issues when I was trying to install my current development on the iPhone and this information about the AppID fixed it.
For quick reference, the AppID you created when you started creating certificates for development and provisioning of your iphone asked you to create a reverse domain name identifier. Something like: QS32H9XPNE.domain.subdomain.companyname.*
To correctly link up your application to the AppID would require you to set the identifier in the application to domain.subdomain.companyname.application.*
Hope this helps
I had the same problem but this solution works...!!!
1)Deleting the app from simulator.
2)Quitting simulator.
3)Restart simulator.
XCode menu->Clear cache solved my problem.
This happens to me when i switch from testing on the device to testing on simulator. Restarting Xcode and simulator gets rid of this error for me.Silly.
I initially solved this by restarting the iPhone Simulator. But this shouldn't be the answer.
The error came from editing the info plist.
Check that you didn't change any values that were set before provisioning your app for your device.
I wanted to change my Bundle Identifier, but had to go back to the default one after having this error.
Now it's fixed.
Next step will be to get a new provision Id with the Bundle Id changed.
I had same problem, the Simulator would just hang. This is on a fresh install of XC 3.2.5 GM and using Simulator with 4.2 SDK. Apps would run fine on a real device but the simulator would just hang.
I ended up changing the iPhone App Support directory and all sub dirs to 777 access permissions. Not a great idea to 777 -R, but I was desperate and it worked.
$sudo chmod -R 777 ~/Library/Application Support/iPhone Simulator/
For me this was solution. If you have enable background fetch mode. Remove this option if you are getting this alert during run app in simulator.
I had the same problem.
It happens as follow...
I had a folder storing images in some sub-folders.
If I add the root image folder as "directory", I receive this error.
If I add the root image folder as "group", simulator runs fine.
weird...
It happens to be related to folder name as well. My image folder was originally named "contents" and I got the error described.
Changed the folder name to "image_files" and reimport it to Xcode project as "folder". It works!
This is totally random...
That did it for me, too:
This happens to me when i switch from
testing on the device to testing on
simulator. Restarting Xcode and
simulator gets rid of this error for
me.Silly.
When a home directory mounted in NFS you have the problem with the simulator.
To get rid of it, you need to to create a couple of directories in some local place where you have permissions to write, "iPhone Simulator" and "Interface builder". Then remove "~/Library/Application Support/iPhone Simulator" and "~/Library/Application Support/Interface Builder 3.0". And finally create symlinks at the exact places of the removed directories pointing to the local directories.
For mine, I got the error when I tried to change the App bundle ID setting in my info.plist file for the sake of running a test. Changing it back cured the problem, but didn't do me any good for the test. Thankfully, the app had loaded in the simulator and I ran it manually for my test.
As far as I can tell, the problem stemmed from having a bundle ID that matched both a specific ID and a wild-card ID. The App IDs I've tried that match only a specific ID/Profile haven't shown a problem.
Check your console and you will get a better idea of what the error might be. That error number is pretty generic. In my case I had an error in my Plist file. I chenged something that I shouldn't have. But I realized this was the problem because the console had a more detailed error message:
2010-09-13 23:30:27.149 Appname[5580:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle:
... and it goes on.
I have had this problem frequently, and generally just quitting and restarting Xcode works.
However, I just had this problem again and nothing seemed to fix it - quitting the sim, Xcode, rebooting… What was strange was some targets worked (I have multiplied build targets for this project), and other projects worked. But one target failed to launch no matter what I did.
In the end, I found the problem: In the target's properties the executable name $[EXECUTABLE_NAME] got accidentally deleted ! Replace it, and it works.
Worth remembering…
I got same error. This is how i solved it. Hope this helps.
To show all hidden files type below from command line
$ defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder
Access DerivedData folder and delete it's content(under DerivedData). Basically this is Simulator Cache which sometimes does not get deleted from XCode. Library is a hidden folder
and that is why we run Step 1.
/Users/your username/Library/Developer/Xcode/DerivedData
Quit and re-open simulator , it will work i also got an issue like this and this helped me.
I am facing the exact same issue very frequently, what I do is
1) I quit the iphone simulator
2) and if after following step 1, if issue still the same, then reset the simulator
And it has resolved my issue all the time from step 1 itself.