Receive message "A signed resource has been added, modified, or deleted" when trying to debug an App on iPhone - iphone

While attempting to debug a build created using the 3.2 SDK on an iPhone device I receive the message "A signed resource has been added, modified, or deleted.".
I can clean, rebuild, then install with no error, but if I try to install without cleaning the error shows.
Anyone have an idea as to what might be causing this?

I found a workaround for the bug.
If you delete the .app file in build/Debug-iphoneos/ before building for the device, the app gets installed without errors.
And there is a simple way to do that before every build.
Make sure you have selected "Device" in the dropdown overview menu.
In XCode go to Project > New target...
Then find "Shell Script target" under MacOSX/Other
Name it and add it to the current project
Now, in the left navigation panel, under targets, expand your newly created target and double-click on Run Script.
In the window that opens replace "# shell script goes here" with "rm -fr build/Debug-iphoneos/*.app" (without the quotes).
Now open your main target preferences and under Direct Dependencies add your newly created target.
Build and Go! :)

This error occurs when there is a special character in the Product Name. In my case it was a "?"
If you change the Product Name it automatically updates the "Bundle Name" and "Bundle Display Name" so it is often the best choice to rename an app.
If you want to include special characters in the app name you have to manually rename the "Bundle Name" and "Bundle Display Name"
Bundle Name: This is the actual app bundle name in the file system such as "Awesome App.app". It is generally not visible to the user.
Bundle Display Name: This is a short name displayed under the app icon on the device. Since the bundle name would be truncated to "Awes…tion" you have the option to have a shorter name which fits better such as "Awesome App". It should be similar to the App Store name (set in iTunes Connect)

This is pretty clearly a bug in the 3.2 SDK, but I don't want to downgrade. I've found that doing a Clean by pushing Command+Shift+K, then Return is pretty fast before pushing Command+R to build.

Xcode 8, reason of the "A signed resource has been added, modified, or deleted." was that target was signed with an enterprise provision profile.

In my case, it happened when no changes were made. Make a change to any file and run again.

This can have several causes. The fastest way to figure out what is causing it is to go into Xcode, Window menu, Devices, then click the reveal button at the bottom of the pane to show the Console. Now attempt to run. You should see log output that names the specific files it is complaining about.
Most of the solutions previously posted are just artificial ways of getting Xcode to regenerate the contents of the build folder and/or re-sign the files.
In my case, my WatchKit extension was somehow acquiring references to Cocoapods frameworks that were only targeted toward the main app so they got signed during the build, then pruned later (as they were not used). Then on device, iOS complained that they were missing from the .appex folder for the extension. I ended up not needing any pods in the extension so I just removed them all and removed the extension as a target, then did some minor cleanup to remove the pod-related debris left in the build steps. Now everything works perfectly.

(SOLVED) This is a weird one. I tried everything I could find. Eventually I changed the product name from "Unit Tests (device)" to "Device Unit Tests" - removing the brackets. Now everything works. The spaces in it appear to be fine.
Previously on stackoverflow:
I've just run into this bug with two static library projects. One builds and tests using the GHUnit test runner on the device without a problem. The other projects will not install and gets this error. That means it's something thats different between these two projects. I've so far tried wiping the build directory, taking spaces out of the executable name, and various clean and builds as suggested here.

Same for me, thought it has something to do with multiple targets etc. because I changed a lot there. But it's highly possible that it's a Bug in the 3.2.2 release since I did not test extensively in this sdk version before the massive target changes in my project.

solved my issue!!!
I found out by accident that somehow a space " " found it's way into the Product Name of my app so it was called "First Second.app" instead of "FirstSecond.app". After deleting the space the issue was gone!
I changed it here:
right click on target
Get Info
Build Tab
Packaging Section
Product Name <- The name here will be used for the bundle (.app) name
Hope this helps, let me know!
Cheers,
nils

I could solved by changing project name.
[project]-[Rename] menu. "phase1 (new)" -> "pahse1"

I was getting this same error, but intermittently. I tried all the above and it still didn't work. Today I found what was causing it.
The error seems to occur when editing a xib in interface builder. If you try to run while the interface builder is open in xcode it will cause the above error. To solve just close the interface builder editor. i.e. just select a code file from your project so you are in the Source Editor.

The simplest (and probably most common cause) appears to be rebuilding without any changes.
So the simplest thing to cure it is to make a trivial change to a source file (such as adding a space, then deleting it), and then rebuilding.
If this doesn't work, feel free to try all the other answers here.
For months, I'd get this error without realizing it was due to such a simple cause. I'd usually do a Clean Build to get rid of it.

When I created ipa through terminal using xcodebuild commands, ipa created but while installing it I was getting same error. exportOptionsPlist solved my issue.
xcodebuild -exportArchive -archivePath projectPath/myapp.xcarchive -exportPath projectPath/myApp.ipa -exportOptionsPlist ProjectFolder/exportPlist.plist

In my case, Quit and restarting XCode worked.

For me the issue was related to the provisioning profile settings. The clue to this was that debug builds were installing ok, but release builds were not. I wanted to test a release build, so I ran the scheme with that build configuration.
I fixed it by duplicating the Release Configuration, then modifying those fields in the Build Settings to have the same provisioning stuff as if I am debugging it.
(Adding another build configuration will give you headaches if you are using Cocoapods however, then you'll have to modify your Podfile)

I'm getting the same thing, when installing on a iPod Touch. I can't link for the simulator (for other reasons), so can't say whether the problem occurs there.
Yes, rebuilding clean or deleting the app from the device allows me to install again. Neither are desirable, iterative solutions!
The minimal "cleaning" I've come across as a work around is manually deleting the Foo.app in the build/Debug-iphoneos directory.

it seems this is a bug in xcode 3.2.2:
iphonedevsdk

I had the same problem in Xcode 3.2.1 when I put a + in my app name. Specifically the "product name" in the build settings. It is fine to have a + in the bundle name in your Info.plist. The same probably applies to other punctuation characters.

Go to Window > Organizer > Projects > Find your project and delete derived data

I got this error intermittently while installing app using iPhone config utility on Windows7. Following solution works - Go to C:\Users\{lanusername}\AppData\Local\Temp and delete app specific folders (e.g. abc.app) and try installing app again.

I reported this bug on ICU (Windows versions) to Apple in June 2011. With the following workarounds:
The workaround is this ....
Win XP
1) Close ICU
2) Delete the temp folder: c:\Documents and Settings\[username]\Local Settings\Temp\[AppName].app
3) Delete the deploy folder: c:\Documents and Settings\[username]\Application Data\AppleComputer\MobileDevice
4) Restart ICU. Drag in the App and install normally.
============================
Win 7
1) Close ICU
2) Delete the temp folder: c:\Users\[username]\AppData\Local\Temp\[AppName].app
3) Delete the deploy folder: c:\Users\[username]\AppData\Local\Apple Computer\MobileDevice\Applications\[AppName].app
4) Restart ICU. Drag in the App and install normally.
=========================================================

I simply rebuilt my app, and that solved the issue.

I also faced the same issue. After wasting lot of time I realized that my product name has a special character "?" which cased the problem

Having the DerivedData folder at a network location caused this problem for me.
After trying everything else, I found out my workstation couldn't agree with the University server about what the time was. (It thought everything was always modified). I also had to clean for every rebuild to avoid that frustrating message.
In the end I gave up and built locally, changing Xcode > Preferences > Locations ... feeling altogether pretty dumb for having ever built over the network.

We ran into this issues on XCode_6.3.1. We were building a AppleWatch app, with an extension. We do have a bunch of Pods.. After debugging the issue for almost a bunch of hours, what we found was that there was an issue with the way a file was adde to the project..
It seems like some references to a unused file was sitting in the iPhone App, though it was used in the Watch App.. It turns out that the error XCode was showing was totally useless.
After removing this file and re adding it back to the project the project started working fine & was able to install to the device. To make it even harder to debug the issues, the debug version was installed without an issue, but was unable to install the norman version..
Make sure you add your files to the right target and, look at git history and see if there are lingering fragments that are added to the wrong target.

This is a very general error message indicating something is wrong during the validation process of the code signature. To find out the specific error, you can go to Xcode->Window->Devices and check your device log.
In my case, I have following console spew
Feb 1 18:53:07 iPod-touch installd[40] : 0x1001f8000 -[MICodeSigningVerifier performValidationWithError:]: 192: Failed to verify code signature of : 0xe8008017 (Signed resources have been added, removed, or modified)
Check on this 3rd party framework again, I found an extra CodeResources file under the framework root. Remove that file fixed the problem.

Related

Xcode compiles my App, but can't run it in the simulator

when i compile my app, Xcode just says "Attaching to Projectname..." and gets stuck there.
The debugger just prints this out:
error: failed to attach to process ID 0
I tried to clean & build again and it still doesn't work out. I googled but couldn't find anything helpful.
How can I fix this problem? Thank You!
The solution for me was to delete everything Xcode has generated earlier:
the App on the Simulator...if this is not possible because you cant
reach the Homescreen, you can delete the App directly under
~/Library/Application Support/iPhoneSimulator/6.0/Applications
delete the Derived Data in the Organizer under Projects or directly
in ~/Library/Developer/Xcode/DerivedData
clean the Build Folder by choosing "Product" in the MenuBar and click
while you press the Alt-key on "Clean Build Folder"
Restart Xcode
Have you tried closing down the simulator entirely, or failing that, reset the simulator and all its contents usually does the trick.
What finally got the simulator working again for me was deleting everything under Library/Application Support/iPhone Simulator/ within the user directory. What I think caused the problem for me in the first place was trying to use a directory named 'Resources' as described here: https://stackoverflow.com/a/1265168/649
This happened to me when I had two xcode projects open with the same bundle identifier.
Solution: leave only one project open which has the same bundle id.
Lindemann's solution worked for me. Nonetheless, during further development I came across another situation that generates this problem: if you create a folder reference (blue folder on Xcode's file explorer, as opposed to the yellow ones which are just groups) called "Resources" the same issue will arise. The solution in this case is to simply rename that folder.
After this, follow Lindemann's solution.
I had similar issues when i installed XCode 4.5 on OS X Mountain Lion. I searched a while and tried some fixes but what finally solved the problem was adding "127.0.0.1 localhost" to my hosts file (/etc/hosts).
Here is what i have done:
Open a terminal shell with cmd+space > terminal
type in "cd /etc"
type in "sudo nano hosts"
type in your root password
add "127.0.0.1 localhost"
save with ctrl+o > return
close with ctrl+x
log out and log in again or restart
Ctrl-Shift-Option-K (same as holding down option and selecting Product ... Clean Build Folder) has always worked for me.
What seemed to work for me was build & run my code so that it opened the Simulator, then hold down on the Simulator Icon in the Dock and select Options -> Keep In Dock
After this I just closed the simulator and launched it from the dock and deleted the app from the home screen on the simulator.
Build & Run the app from XCode and everything seemed to be OK again.
There seems to be quite a lot of things that can cause this error, but for me it turned out to be that I was missing the key CFBundleIdentifier from my plist.
Added it back, and the simulator started normally.
Also make sure none of your file/group name collide with the projects default settings.
Things started breaking for me when I added an info.plist file to my project (Bad Idea). Same happens when you add a "Resource" Group. I don't have an exhaustive list, but if someone does please do share.
Cleaning out / Renaming these conflicting files and following the solution provided by Lindemann(https://stackoverflow.com/a/12504712/2069749) solved the problem for me.
What worked for me was that I realized i was messing with the project settings and accidently removed the info-plist section. After specifying the plist file again properly, it worked. Hope that helps someone.
You need to change the debbugger LLDB to GDB. This helped me start my program in the simulator.
If you are using a network account, you should replace the "~/Library/Application Support/iPhone Simulator" with a link to a local directory. This worked for me after trying everything else.
Make sure you do not have an invalid build rule, that will cause this error, happened to me once (I had added a build rule by mistake and left it invalid).
I had the same problem, in my case i have left the ios simulator open in one user account and switched (without logout the previous one) to another user account. I couldn't event able to open ios simulator to clear and reset its settings. [Shows could no open ios simulator OSStatus - 10829]
My solution:
I quit the simulator in the first user account and then came back to second user account, every thing is working fine.
try to do next steps:
Go to Product/Scheme/Edit Scheme then select Run section.
Select Info Tan and set Debugger None.
Run project. It must be working (without debugger)
Go back to Edit Scheme and selecet debugger LLDB
Run project. It is working.
Maybe additionally you need to delete derived data and do Product/Clean
Can't tell you how frustrated I am trying to narrow down the cause of this one. Took me hours. Trial and error here and there.. all leads to nothing until one comment in one of the threads relating to this mentioned about "Executable". Boom! I remember the plist key "Executable file" in my project plist (PROJECT-info.plist). So I got there and found out that that entry was missing. I filled it in with whatever default you see when creating new project, "Executable file" paired with "${EXECUTABLE_NAME}". Build + Run. Then it finally worked!
Btw, I did try all those deleting/resetting stuff found all over SO. None of them works.
If resetting content and settings in the Simulator doe snot work for you, make sure that there is an entry for localhost in your /etc/hosts file:
127.0.0.1 localhost
Some programs can delete the line or comment it out (#) or even delete your /etc/hosts/ file completely. I tried everything described, but once I added localhost back to the file, the simulator worked perfectly for me.
What worked for me was to select 'Delete Derived Data' from the Projects tab in the organiser.
I fixed my problem by I making a new blank project and importing all the old files.
It must have been a problem with Xcode because it worked before iOS 5.1.

Xcode 4.2. gets stuck "Attaching to myapp" when running

In xcode 4.2, sometimes when you're going to run your ios proj on simulator, the status windows says "Attaching to myapp", and just gets stuck there... until you cancel.
Now, this has been asked before:
XCode 4 hangs at "Attaching to (app name)"
and surprisingly, besides the accepted answer on that thread, there are at least 10 other possible solutions others have been adding, all for the same issue, people says one of them worked while the others didn't...
please note, this is not a sequence of steps. each one is a possible solution:
1- restart xcode and/or restart simulator (reset content and settings) and/or restart computer.
2- click on project name in project navigator. in build settings tab, go to packaging and make sure that "Product Name" is the same that the one xcode says simulator is attaching to when running. if they are different, it will fail.
3- go to your projectname.xcodeproj folder. inside there delete anything named with your userid. when you reopen xcode those files will be recreated and it should work…
4- Manually delete the build directory for your project.
5- Go to organizer window. select Projects, select your app in the left hand side and then delete over "Derived Data"
6- Check Launch option is set to "Automatically" in Product->Edit Scheme, "Run" scheme.
7- In Project->"Edit Schemes"->Run. Change the Debugger from GDB to None (this doesn't make sense to me..).
8- Kill the process gdb-i386-apple-darwin from Activity Monitor. this is assuming gdb is not responding.
9- In "Product"->Edit Scheme. in Run, click yourappname.app, choose other, navigate to your .app in your project. now run.
10- Check that you don't have two different Info.plist in your project. if you do, remove the bad one.
In my case, none of them do the job. My project builds succesfully, everything seems fine, .plist, bundle identifier, name, etc.. and still can't pass the "attaching" part. i don't understand the reason of this, so any suggestions to fix it and possibly understand the problem i'll really appreciate it.
New projects were failing to launch in the simulator, getting stuck on the attach step.
This seems to be after Xcode 4.3 was installed, but I can't recall the last new project I created.
This is what worked for me, the clue coming from this thread...
Project->"Edit Schemes"->Run. Change the Debugger from LLDB to GDB
Another computer with the same version of Xcode works fine. Maybe my LLDB is corrupt?
Did you recently upgrade to OSX 10.7.2? I started having the same problem after I upgraded. I noticed that the Simulator always get stuck if I'm connected to a Wi-Fi network that forces Captive Portal authentication. This happens with other apps as well (Chrome, Safari). I'm not really sure why this happens, but I did read that 10.7.2 has issues with Captive Portal authentication.
Anyway, in my case, I repaired disk permission from Disk Utility and rebooted my machine. This seems to resolve the issue.
Just rebooting the computer worked for me.
Tried all the solutions but none applied to my case. XCode 4.2, OS X 10.6.8
Found that the Info.plist bundle identifier had been accidentally deleted when adding a custom app icon. Adding that back fixed the problem.
Anyway that's my fix, hope it helps someone.
Also before figuring out that, found I could start the simulator from another app and then use the app icon on the simulator for the app that would not attach, and start it up that way.
seems like there seem to be a lot of things causing this, but one thing that worked for me was simply cleaning out the build folder by pressing Cmd+Option+Shift+K or alternately if you select the Product dropdown in the toolbar and hold the Option button you should see the "Clean Build Folder" option appear
I also tried all solutions in that topic but all failed. But finally it was found out that what was went wrong.
What made this issue occurred is that some settings in Target->Build Settings was got modified by me for including C headers. And after I added all C headers and make it built. This issue occurred.
It might be only works on the situation I described before.
I just created an empty project and check all items in Target->Build Settings between the attaching-stuck app and the empty one. It was found that some items in the attaching-stuck one was different from the empty one.
So I deleted it and make it attached successfully.
It seems different in my case and also solved in a different way. If you got stuck every time after drop some files or folders into your project with the 'Create folder references for any added folders' way, this will be the solution.
Click the project node(the root node) on Xcode's project navigator and select target node. It's under the 'TARGETS'. Then click the 'Build Phases' tab. There are 4 sections of some list and you can click the triangle to expand the list.
You need to concentrate on the 'Compile Sources' and 'Copy Bundle Resources' section. Code files like .m must be placed on the 'Compile Sources' section and are compiled automatically. Resource files like .jpg must be placed on the 'Copy Bundle Resources' section and are copied into the project's package.
So, if the dropped files and folders are not in the 'Copy Bundle Resources' list, just drag it form the project navigator and drop onto the list. That will solve the problem.
If it doesn't work, delete all the referenced files and folders, click '+' button on the resource (or compile) section and click 'Add other...' button. Then you can include files and folders as the 'Create folder references for any added folders' way. I think the 'drag and drop' works well after the '+ button' way is done once.
In addition, 'Resource' may not allowed for folder name.
I experienced the 'stuck' problem every time when I attach files and folders as reference on Xcode 4.2 ~ 4.3.3. Reinstalling mac was a useless effort for me.
I have noted in Lion that when the iOS sim locks up or hangs the app,
that if I go to a shell, and do ps -ef |grep SDK, I will
see many, many processes running associated with the simulator.
I tried to kill off these processes but they rapidly respawn
and the only solution then is to reboot. Also, in the ps output,
you will also see instances of your app running as well.
So the Simulator issue is caused by previously running processes
that appear to block the correct running of the latest one.
I guess Apple will have a fix for this eventually, as it is quite onerous.
Rebooting works for me, too, but this shouldn't be necessary. I'd recommend filing a bug at bugreport.apple.com. You can duplicate the one I created - the more it's duplicated, the more likely Apple is to fix the problem.
I tried all of the solutions above but without luck ...
When I search for simular problem here :
Xcode error: failed to launch [directory] -- invalid host string: 'localhost'
I found it fixed my problem!
Hope this helps those who are still searching for a clue .
Upgrading to XCode 4.6.2 resolved this issue for me
Even if the app is not attaching after cleaning the project, changing the app name, restart the by resetting the simulator, and if you are using LLDB compiler, it is because the LLDB compiler is not able to connect to the local debug server in order to solve this, take a look at this
Why does the LLDB Debugger constantly fail to attach?
This really solves your problem!

Xcode 4 hangs at "Attaching to (app name)"

I just upgraded to Xcode 4 and for some reason my app won't run in the simulator or iOS device. It was working perfectly in Xcode 3, but all of a sudden now when I press run the program stops at "Attaching to...". There doesn't seem to be any other info to help with this problem either.
For summary you can try following things to tackle the issue:
Restart the simulator.
Make sure that you haven't included the Info.plist file in your Building Phases -> Copy Bundle Resources.
Resources folder added to the project as a folder reference (the blue folder icon). That caused the trouble, after adding the folder as a group the problem went away.
Fixed it!! Hopefully this helps some people avoid a very frustrating couple hours. I solved this by:
Clicking on the project name in the left pane (at the very top). This will bring up a new menu to the right, something like the project/ target editors in XCode 3.
Click on Build Settings up at the top.
Under Packaging make sure your product name is the same for every build, and equal to whatever it says it's attaching to. Eg if XCode is Hanging at "Attaching to myLCBO" but your product name is "LCBO Finder" then it won't build. That was exactly my problem because I renamed my app half way through development.
Here was our fix:
In Project > Edit Schemes > Run.
Change the Debugger from GDB to None (directly above the green circle in the image above).
A tip I found at the Apple Developer Forums:
Go into your ProjectName.xcodeproj/
directory and delete anything named
with your userid. Re-open the
project in xcode and all that will get
recreated and it should work. At least
it did for me.
Another tip is to manually delete the build directory.
Yet another tip is to navigate to the Organizer (Shift ⇧ Command ⌘ 2 in xcode 4), select Projects, select you application in the left hand side and then the Delete...-button to the right of Derived Data.
And never forget the universally useful tip: restart your computer and try again.
Good luck!
Solution provided didn't fix the problem in my case.
In order to solve it (XCode 4 only), I had to go to Product -> Edit Scheme. Then select the "Run " scheme, and marked "Automatically" which wasn't enabled.
Hope it helps someone.
For everyone still trying to resolve this after everything you tried from above, try reseting the iPhone Simulator.
Simulator > Device > Erase All Content and Settings...
This will erase all apps from simulator, but now you can finally use simulator!
Also: make sure that you haven't included the Info.plst file in your Building Phases -> Copy Bundle Resources. If so, remove it from that list! I small mistake which could happen, but something that messes things up quite nasty :S
Restarting simulator works for me :)
One more possible solution: I had my Resources folder added to the project as a folder reference (the blue folder icon). That caused the trouble, after adding the folder as a group the problem went away.
I really find the answer for me :)
for me,
project setting -> your target -> build phases -> validate setting -> perform
and now the problem is gone.
:)
I hope someone it help
I solved this problem how:
1) iOS Simulator->Reset Contents and Settings...
2) Sure project name, scheme name and target name is identical. "AppName" and "Appname" is not true. Must be "AppName" and "AppName", or "Appname" and "Appname".
3) Restart XCode and Quit Simulator.
Project name at Build Settings->Product Name.
Scheme name at Product->Manage Schemes. Click on current scheme once for rename.
Target name at Column of Project with Targets. Click once on current target for rename.
Good luck =)
Like Rob said, but also check the "identifier" should read by default "com.yourcompany.YourAppName" I had changed the "yourcompany" by mistake and this caused the same issue noted above.
This also seemed to happen to me when the info.plist file was in the copy build phase. It appears that sometimes Xcode will warn you about this, and other times it won't. Very strange. But if you are experiencing this issue, make sure that info.plist is NOT in your copy build phase.
My problem was also a folder named "resources" on the root source folder. Looks like it conflicts with some internal build naming.
Renaming the folder to "res" solved the problem for me.
I tried everything in this page, and the "new" solution that worked for me was to go into the simulator, and "Reset Content and Settings" in the iOS simulator main menu.
This solution is not technical but it worked for me.
When Attaching to Process shows up in xcode and it hangs for a while, just quite the iOS simulator and re-launch the app by pressing Command + R.
It will launch the app without any issues :)
I tried everything and nothing worked. I have an old project from XCode 3. I simply renamed info.plist in the project to another name, restarted the simulator and everything is working fine since.
I frequently encountered this problem after renaming a project in Xcode 4.
I was able to fix it by editing the Bundle Identifier in the .plist file.
After I renamed the project, the Bundle Identifier would change to something like this:
com.yourcompany.${PRODUCT_NAME:rfc1034identifier}
changing it back to this:
com.yourcompany.${PRODUCT_NAME}
will stop Xcode from hanging and allow the App to run.
For me, none of these has worked. I realized that my project had 2 info.plist files (with two different names, like info.plist and Project-info.plist), so XCode got confused. I just removed the incorrect plist file, and it worked!
Under Product > Edit Scheme > Run > Info, changed the Debugger from LLDB to GDB worked perfect for me!
I had the same problem. The issue was there was one more user who was logged in and had the simulator running. Think there can be only one instance of iphone simulator running on a machine even for different users. Hope this info would be useful for somebody :)
What worked for me is the following:
In XCode:
Click on project name
Click on target name
Click on "Build Settings"
Reveal "Product Name" contents (click on triangle)
Make sure the name of all items matches that of project name
Example
Product Name myapp
Debug myapp
Release myapp
Reveal "Deployment" contents (click on triangle)
Make sure there is a "IOS Deployment Target" item
Example
IOS Deployment Target IOS 3.0
Debug IOS 3.0
Release IOS 3.0
Then clean and run.
This is what worked for me:
In Xcode navigate to the Product menu and choose EDIT SCHEMES.
In the list on the left choose Run YourAppName.app. From the Executable menu choose OTHER.
Navigate and choose your .app file in your project directory.
Now run and it works :)
I noticed it happened to me when I edited the scheme from Build Release to Build Debug.
I changed back, and it worked :)
What worked for me:
Launch "Monitor" and kill gdb-i386-apple-darwin which was supposedly hung
Restart iOS simulator
My solution is correcting the nib name. (I changed my nib name before for an iPad version but then I deleted the iPad nib file). Then it works well again.
All of the above suggestion didn't resolve my problem.
After I added the Resources folder and and compile, it hangs on attaching to app-name.
I removed Resources folder, still hang.
I removed the project and recreate a new one ( with the same name ) but still having problem.
If it was different name then it's ok. I restarted the OS but still doesn't help.
To solve the issue, I did the following:
1. ps -ef | grep Xcode, and kill all the "Xcode" processes.
2. Reset the content of Simulator, and quit the Simulator.
3. Product > Clean to clean up the build.
4. Compile and run the product. It should work at this point.
Hope it helps some else having this similar issue.
I encountered this error after incorporating another project inside my new one. Make sure you delete the project that you have added's info.plist and .app
Just came across the same problem: restarting the simulator and Xcode didn't work for me, while restarting my mac worked out pretty well!
After all said and done. I had to stop the simulator. Then the message change to downloading Mac OS X 10.6 core library.
Create a new user account, switch to account, open XCode and try running the project. After trying all of the other suggestions with no success, not only was I again able to run on sim, but the original account now works.

Xcode's Build and Archive not working

The current issue I'm having is that Build and Archive will build my current target but after it's finished building, a pop-up will appear with the message:
"The operation couldn't be completed. No such file or directory"
I have reinstalled Xcode (3.2.3 with SDK 4.0), rebooted my machine, cleaned the cache, cleaned the project, manually deleted the project build directory. Nothing has worked.
I've also checked ~/Library/MobileDevice/Archived Applications and it is empty.
Any ideas?
p.s. This is driving me crazy!
The error The operation couldn't be completed. No such file or directory also occurs in XCode 4.0 GM preview if you do not change identity to "Don't Re-sign" after selecting (Archives) Share in the Organizer
I had this problem and the solution that was recommended to me was:
Open your Xcode project
Select Unity-iPhone in targets (Double click so it opens the info)
Find "Generate Debug Symbols" and check it on. (Just Search for it in the search field)
This worked for me, but I still don't understand why it was necessary.
All answers failed. Best solution,
drag the .app bundle to iTunes and reveal the app in Finder. Boom! you get your ipa there.
Since it only seems to happen with your release configuration, double check the "Build Locations" values in your project settings for the release configuration.
Check the paths in the "build locations" to make sure they exist
Check the permissions for those paths
Try doing just a build (no archiving) for your release configuration
Also keep an eye on your build results window during the build to see if there were any warnings during the signing and packaging stages that could give you clues
Had the same issue and none of the mentions solutions worked.
I finally found the problem when I tried to directly sign the app with the adhoc profile: it told me that I had twice a distribution profile in my keychain. I deleted the old one, then compiled again with the dev profile, and then archiving with the adhoc profile and it worked.
Longshot answer - do you have any unusual characters in your project path? This release note indicates it can cause problems:
While most known cases have been taken
care of, having a space, comma, slash,
backslash, tilde, or other character
special to the Unix shell in the
directory name of any parent folder of
your project can cause your project
build to fail in unexpected ways.
If you have a 3:rd party SDK you need to add "$(SDKROOT)/ResourceRules.plist" to the “Code Signing Resource Rules Path” key in the targets build settings.
I solved this problem by exchanging the wildcard adhoc distribution profile I was using for an app specific adhoc distribution profile.
Of the top of my head, I would check permissions. Some code reports permissions problems as there being no file/folder. Check the Console log. You will sometimes find more info there.
Did you install into /Developer? If you've customized that folder the issue could be that the path contains a space, which could be causing your problem.
Run the Console app and see what information is being spit out there. That should give us more insight into the issue.

Upgrade to iPhone SDK 3.0 Causing UIKit Problems

I have an existing project that I was working on, and I recently decided to update my iPhone SDK and updated to the latest 3.0 SDK.
I update my SDK and go to open my existing project. Sure enough, there are some problems including some certificate problems and so on. Anyway, google and I were able to solve most of them, but I haven't had any luck on what I hope to be the last of my problems.
When running my program in the simulator, I now get
dyld: Library not loaded:
/System/Library/Frameworks/UIKit.framework/UIKit
Referenced from:
/Developer/iGameLib/iGameLib/build/Debug-iphonesimulator/iGameLib.app/iGameLib Reason: image not found
Now, I discovered the UIKit has moved to
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0sdk/
System/Library/FrameWorks/UIKit
and I have updated my target and project settings to point to that new framework location, but still when I build it, no luck.
I have also tried clearing out the simulator's applications and settings, still no luck.
The referencing .app is cleared when I run the "clean" menuitem, I have confirmed this, so clearly something in my project settings are still pointing to use the old UIKit location.
Where should I be looking?
I've gone as far as I can to help myself but I'm afraid I'm at a loss here. I don't see it under the target settings, or the project settings, or the plist, or any of the other files within my project.
I was getting the same error
dyld: Library not loaded: /System/Library/Frameworks/UIKit.framework/UIKit
The solution on my case was simply quit Xcode and try again.
OK, SO I HAVE THE ANSWER!!!
Quite simply, Xcode is not changing all of the variables correctly in the actual .xcodeproj file. So, here are the steps I took.
Get out of Xcode, you've got to do this job at the terminal. Bring up a terminal and go to where your project is. Find your .xcodeproj and go into it as if it were a directory. It looks like an actual file in finder, but it is one of those package directories.
Now, I couldn't get textedit to allow me to edit it, but you can go into nano, so like I did
sudo nano project.pbxproj which is under my .xcodeproj file/folder/package/whatever.
In this file, you need to find where the SDKROOT is set. Chances are there are a few places it is referenced, but you're looking for SDKROOT = iphoneos2.2.1 or something similar. Change ALL OF THESE (there are a few) to SDKROOT = iphoneos3.0
Now, you're half way there. do ctrl x and save the file. Next you're going to do ls and find out what the .pbxuser file is. Mine is myname.pbxuser. run the same command of
sudo nano myname.pbxuser
In this file, there are a HUGE number of references to the 2.1 iphone sdk directory. Do a search/replace of iPhoneSimulatorOLDVERSION.sdk, in my case it was iPhoneSimulator2.1.sdk
and change the 2.1 to 3.0. Be very careful with this though, I wouldn't want to know what happens when you mess this file up.
Save it and open xcode. CLEAN the project and build and run. Presto!
Check your target settings
Make sure you're actually linking to all of those frameworks in the Target (check under "link binary with libraries")
Make sure you've chosen the 3.0 sdk as your base SDK
Create a blank project and add your frameworks as before; if you still have issues, probably a borked SDK install
BTW, you shouldn't have to re-add sdk frameworks, as the paths are relative to the current SDK
Just trying to be helpful… not sure I can debug from here :)
I have had some similar problems with Xcode that seem to have no apparent cause. The fact of the matter is that Xcode does still have bugs here and there and sometimes you WILL run into a wall.
My Experience: Similar to your situation somewhat, on one particular occasion, an Xcode project I was working just stopped building for whatever mysterious reason, and no amount of cleaning, googling or SO-ing provided me any answers. So I simply created a FRESH, NEW project and filled the source-code from my corrupt project into that of the new project. The new project used the SAME source, libraries, resources, settings, mind you -- and yet it built with no problems. It took about 20-25 minutes to make the transfer but considering that I had spent several HOURS trying to address a bug that would not reveal itself in the corrupt project, the time was well worth it.
So, I'd suggest doing what I did: Maybe try creating a fresh project and transfer your old source and resources over.
Good Luck
I just deleted the UIKit.framework from the 'Frameworks' folder, right-clicked and added it back again.
Clean build, and no problem..
I had the same problem using Xcode 3.2.1 but it was solved in an easier manner. I realized I had recently disabled my target's environment variables, specifically ones to do with memory debugging (NSDebugEnabled, NSZombieEnabled, NSAutoreleaseFreedObjectCheckEnabled, MallocStackLogging, MallocStackLoggingNoCompact). The app ran once in the simulator after removing the environment variables but never again after that.
Quitting Xcode, the Simulator, restarting Xcode and doing a complete clean of the target (including it's dependencies off course) brought me back to a good state.
Same problem when launching my application without debugging.
In my experience the produced binary does not seem to be the culprit.
I created an app from the xcode wizard which does launch OK in the simulator (let's call it testApp, my application being called myApp), I tried to figure out where is the difference with my app.
otool -L myApp
gives correct (relative paths) to the frameworks, same as testApp
ps -E
DYLD_ROOT_PATH, DYLD_FALLBACK_FRAMEWORK_PATH, DYLD_FRAMEWORK_PATH, DYLD_LIBRARY_PATH environment variables needed by ld to locate the framework
are OK for myApp compared to the values of these variables when testApp is launched
I suspect that the problem lies somewhere in the communicartion between XCode and the simulator once the app is launched ... altough I can't find what's wrong ...
The solution that worked (at least for me) have certainly some big side effects but here it is :
quit xcode
browse the content of the package myApp.xcodeproj
unlock .model1v3 and .pbxuser for modification (the lock in the information panel (cmd-I on the file))
delete these two files
start xcode and retry to launch your application from there