xcode 4.2 can't run app - iphone

I'm trying to build my app on my iPhone 4 but i keep getting this same error. It has bein run before and has worked fine but i changed my icons and now this is what i get.
Command /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/PrivatePlugIns/iPhoneOS Build System Support.xcplugin/Contents/Resources/copypng failed with exit code 1
The error is called CopyPNGFile

You might have deleted a file in your project's folder without telling XCode, and it still tries to include it. Expand the folders in the Project Navigator and look for files in red, then delete them with a ctrl-click. XCode should be happier after that.

Related

Installing IPA results in error "A signed resource has been added, modified, or deleted"

I've recently stumbled upon a rather odd problem with Xcode which occurs when I build an IPA and attempt to install it, I've tried installing using Xcode, iTunes and iPhone Config Utility, all of which give the same error
A signed resource has been added, modified, or deleted.
I can successfully debug the app on my phone using XCode, it's only when I try to install an IPA I see the error.
I've tried unzipping the IPA and running the codesign validation tool which throws up the following response:
a sealed resource is missing or invalid In architecture: armv7
resource missing:
/Users/dev1/Documents/PoleTester.app/Settings.bundle/._Root.plist
This led me to look at the Settings.bundle file and ensure that it's being included in the build, which it is. Interestingly though, if I remove the Settings.bundle file, build an IPA and attempt to install it on my iPhone the install succeeds, however this of no use as I need the Settings.bundle file installing with the app.
Further investigations on some of my previous XCode projects has shown that I can build an IPA, with the Settings.bundle file included, and successfully install it. However, if I make a simple change to the Settings.bundle file, such as adding or removing a row, build an IPA and then attempt to install it I get the
"A signed resource has been added, modified, or deleted" error.
I'm at a bit of a loss as to what's causing this error and why the Settings.bundle file is causing the install to fail.
Has anyone seen this error before or potentially shed some light on what's causing it?
I'm using Xcode 4.6.3 and an iPhone 4 running iOS 6.1.3.
Clean Build Folder (⌘⌥⇧-K) has resolved this for me 3 out of 3 times.
I just ran into this issue using Xcode 6 beta 6 installing to my iPhone 5 running iOS 8 beta 5. The app I'm building uses a Today extension (aka widget).
It appears the issue stemmed from my having not set up dependencies properly. I have a third party framework (Alamofire) set up as part of the project as a dependency of the overall project, but not as a dependency of the today widget. I could build fine but when installing to device I would get this "signed resource has been..." error.
By adding Alamofire as a dependency of the Today widget this resolved the issue.
It's a bit late but I ran into the exact same issue today with Xcode 5.0.1.
According to https://developer.apple.com/library/ios/technotes/tn2318/index.html, "the resource missing: my.app/..*" error could be caused by:
The file prefixed with "._" is considered an AppleDouble file and it can result from copying the uncompressed Xcode project folder onto a non-HFS+ formatted disk. The AppleDouble files must be removed using the 'dot_clean' command. The Xcode project folder is the argument to dot_clean as illustrated below.
Steps I did to resolve this:
Close Xcode
Run "dot_clean /path/to/My_Xcode_Project" in Terminal
Open Xcode again and make a new build
Oddly enough most of these _* files don't seem to cause any issues except those inside Settings.bundle (Nearly every file in my directory had one, but only after I added Settings.bundle, the IPA failed to install).
I also faced the same issue and this post solved my problem:
http://code-ninja.org/blog/2012/04/17/signed-resource-has-been-added-modified-or-deleted/
It turns out that the problem was caused by having special character in the product name – in my case, a ?. Removing the ? from the product name fixed the problem.
In my case, what helped was adding a bash script into build phases (just before "compile sources"):
find ~/Library/Developer/Xcode/DerivedData -name "YouAppName.appex" | xargs -I % find % -type f -maxdepth 1 | xargs rm
What this script does, is to clean files in project's appex dir (e.g. assets), but leaving sub-directories (e.g. compiled storyboard). In effect, using this script while building is much faster to execute than full project clean.

Xcode 4.2 hangs on "Attaching to (AppName)" until second run

I'm having this issue when I hit Run on the simulator/device, the project compiles successfully but all I see is "Attaching to (AppName)". If I run the project again, it's working fine.
Same is happening when running on the device, but I get alert message, "Could not read from device".
Any ideas?
We had the same issue for weeks on our project. We finally resolved it by removing some of the build warnings we had, specifically ones like:
Warning: Multiple build commands for output file /Users/yosit/Library/Developer/Xcode/DerivedData/Gogobot-dnimbqlmegonbvcyvulfebiqqeor/Build/Products/DebugProduction-iphonesimulator/Gogobot.app/UAPushLocalization.bundle
This happens when you have the same resource filename in different folders on the same project. In our case we removed the UI folder for Urban Airship since we didn't need it. It brought down the number of warnings and removed the problem completely.

Xcode 4 skips coping app to device/simulator

Whenever I attempt to run the debug version of my app, Xcode (4.0) compiles successfully, skips copying and just runs the old version. However if I clean first, Xcode copies just fine...
No relevant warnings, I triple checked the project and target build settings. Skip install is set to NO on main project and targets, all dependency projects have skip install set to YES.
Any ideas would be very welcome, recompiling every run is very painful.
Xcode's Clean command doesn't clean very thoroughly. There's still plenty of derived data retained after cleaning, something of which can cause these symptoms. I've had the same problem happen to me, where it kept running a old version of the app. To fix it I deleted the app from the simulator and deleted the Xcode derived data for the project.
To delete the derived data, quit Xcode. Locate the derived data in your account Library folder (~/Library/Developer/Xcode/DerivedData/), and delete the folder for this problematical project. Reopen the project in Xcode, and build and run.

XCode 4 problem, always showing target view when stops at a break point

I just upgraded to XCode 4.0.2 and ran into a strange issue. Every time when the app stops at a breakpoint, XCode shows the target view instead of the .m file. When I manually click the file and show it, and click step, then the IDE switches to the target view again. This makes debugging virtually impossible. THis only happens to my own project. Sample projects work fine. Please help, it drives me nuts and I can not find where did I get the settings wrong.
P.S, this project worked fine on XCode 3, after upgrading to Xcode 4 I had problems with my targets. After wrestling a while with the schemes it finally builds and runs fine, but I can not do debugging when making changes because of this. I am not sure if I messed up some settings during the time to change the scheme and target settings.
Thanks
Ray
Ok, found the problem, but still not having the real solution. The situation is that the project was originally in one directory called WorldClock, after having problems when installed XCode 4, I copied the folder to another folder called WorldClockNew, and started in this folder. However somehow the build directory is still pointing to the old directory. After deleting the Build folder under WorldClock, this problem went away. However I still can not find where in the XCode settings to correct the Build path..

Xcode 4 Preview 4 displays "Build Succeeded" but with errors

Xcode 4 Preview 4 displays "Build Succeeded", as show the image below there are 5 erros. Actually there are more than 5 errors, but it seems that Xcode doesn't build anymore. It happened when i built the project in xcode 3 while the xcode 4 was open with the same project. Anyone have an idea to overcome this bug and reestablish the Xcode??
I tried to restart the Xcode, restart the mac. I don't know how to clean up the build. The "clean all" option in Product menu is unable.
Thanks in advance.
Follow these steps:
Edit your PCH file
Save it again.
Clean and build
No 4th step.
Hope it helps!
Try going into your Build directory and simply deleting everything.
For Xcode 3, the build directory is usually located inside your main project folder. For xcode 4, as discussed in this question, can be found, by default, in ~/Library/Developer/Xcode/DerivedData.
Also, be aware that you won't be able to clean a target if it's running inside the simulator (though it seems like that doesn't apply in this case.)
I just got this error today and want to explain what I did in case anyone else encounters it.
Xcode would display errors but the build would be successful and run in Simulator. I created a new project from scratch and the same thing happened. I'd insert random lines like "saedrw34" and it would highlight it with the red exclamation point. But the code would still build and run.
Check the autosave settings:
Xcode-->Preferences-->General: Auto-save --> Set to Always.
I remembered that prior to my problems I had changed it to "Never." I didn't realize Xcode, when you hit Run, compiles the latest saved version on your hard drive, not the current version you see on the screen. So basically, it was building a different version than the one with errors.
May be different from your situation but thought I'd just pass it along..
For me the following worked:
Got to the "File Inspector" and uncheck the targets under "Target Membership"
Build the project (maybe also clean build)
Check the unchecked targets under "Target Membership"
Build the project