object file format unrecognized, invalid, or unsuitable xcode - iphone

I know other similar questions have been posted, but none of those solutions worked for me. Updated to Xcode 4.5.1 from 4.3.3 today. Got this error:
Build/Products/Debug-iphoneos/MobileApp.app/MobileApp malformed object (unknown load command 19)
/Users/garyt/Library/Developer/Xcode/DerivedData/MobileApp-cgojnkplmjncbaaigyvelwclibwr/Build/Products/Debug-iphoneos/MobileApp.app/: object file format unrecognized, invalid, or unsuitable
Command /bin/sh failed with exit code 1
So followed instructions here. Downloaded latest command line tools, tried the sudo codesign_allocate fix suggested, and checked to make sure my name and values were matching on both target and product, but still having the "object file format invalid or unsuitable error pop up". New to cocoa/iOS dev and this wasn't a headache I was expecting. Any help would be appreciated. I guess I should also note everything worked fine when I was running Xcode 4.3.3, which is what I updated from.

Best way is to just delete the XCode and install a new one from Appstore.
https://itunes.apple.com/in/app/xcode/id497799835?mt=12

Related

Swift with iPhoneSimulator9.3.sdk in iPhoneSimulator directory doesn't compile

Upgraded to Swift 3.0 with Xcode 8.3.3 but got this error with first simple app build:
Command
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc
failed with exit code 1 error: Swift does not support the SDK
'iPhoneSimulator9.3.sdk'
So I followed the steps here: Swift does not support the SDK 'iPhoneSimulator9.3.sdk'?
including renaming and removing the file, then cleaning and building the project.
But then I started getting a different error, saying: Can not load underlying CoreGraphics. (see attachments).first image.
So first the compiler complained about the presence of the 9.3 simulator and then it complained that it couldn't be found.
I also tried renaming the 9.3 Simulator but still does not resolve problem.
What can I do to get my environment to be correct?
Thanks
Ok the important part was that I had to actually delete the file, which probably freed up a file handle for it.
I had tried to rename it and leave it in the same directory, and move it to another directory.
But when I actually moved it to the Trash, then I was able to clean, build and run the project.

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.

Apple Mach-O Linker Error while Archiving Project

I am getting the error while archiving the project, I googled it for the exact solution but they doesn't meet my requirements.
Apple Mach-O Linker Error Command/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang failed with exit code 1
Some of the solution which I got,
Import the file #import “xView.m instead of #import “xView.h
Cleaning the build and restart the xcode
Missing of frame work
But it doesn't worked for me, even my project running while testing it in simulator.
Finally i solved my issue , actually in my project i have two images which have the same name generally xcode not accept the same name of file but some where it accepted and due to this i am getting the error every time while archiving the project , so i removed the duplicate image and archive the project sucessfully.
hope this will help you guys .
This error generally occurs when some file is missing in the build files. Check if you have remove some class file & its entry still exist in project file.
You can see it in build settings. Hope it'll resolve your issue.
If still not solved, ping the total description below the exception as found in XCode.
There are many fixes but what was my problem was that I did not need a framework anymore, and I removed it but in one of my files it declared the framework at the top still and used that framework. Deleted it and it worked! Plus check if you have not messed anything up in your AppDelegate.m

Binary being analyzed must exist, iOS App Archive in xcode

I'm trying to validate my App for App Store Submission, I've made an update to it. It was using Three20 before, though I'm not sure what version, probably 1.0.3. Now it's using 1.0.5 and I have rerun the python script that adds Three20 to an app with the --xcode-version=4 flag.
I have no linker errors, and it archives fine, but I get the following errors when I try to validate the archive for distribution:
I'm kind of at my wit's end, been dealing with linker errors all day, and general problems with Three20 and Xcode itself. Is there anything obvious I might be doing wrong here?
The binary being analyzed must be an executable:
Check your build settings, because something's fishy. Your Mach-O type should be set to executable:
Application failed codesign verification...
You must sign your executable with a Distribution certificate, you're most likely signed with a Development certificate, or not at all.
The binary being analyzed must exist:
This is probably coming up because of issue number one. Resolve the Mach-O type, and this should vanish instantly.

LLDB does not appear to be reading my .lldbinit file on startup

I have a file ~/.lldbinit with a single alias:
command alias pi print (int)
But when I run my app from Xcode, the alias does not work. However, if I manually enter the alias, then the alias does work:
(lldb) pi 6
error: 'pi' is not a valid command.
(lldb) command alias pi print (int)
(lldb) pi 6
(int) $3 = 6
(lldb)
This leads me to suspect that my .lldbinit file is not getting read. Or is there a different problem that I am missing? Can anyone help?
I had a similar problem. It turned out, that I had a syntax error in my .lldbinit file which leads to lldb silently ignoring the file. You can try manually loading the file with
command source ~/.lldbinit
which will show syntax errors.
Make the file executable:
chmod +x ~/.lldbinit
I created a .llbdbinit file just like you and reproduced your problem in my copy of Xcode 4.1. I can't get aliases to work either.
Since ~/.lldbinit is documented by Apple as supposedly being read when started up, I suspect that lldbinit file reading is currently busted in shipping versions of Xcode 4. Not sure what pre-release versions are doing, but I'd recommend filing a bug at bugreporter.apple.com.
p.s.
One thing I noticed on one blog (here; look in the "differences between OSX & iOS" section) is that lldb only works for MacOS and NOT for iOS, at least as of a bunch of months ago.
Note that ~/.lldbinit does work in Xcode 4.3.2, iOS.
if you created the lldbinit file with some editor then it might have screwed it.
try openning the lldbinit file with vi and check if it just plain text
I had the same problem when trying to get this plugin to work.
command script import ~/Documents/002.ME/001.BITBUCKET_REPO/xcode_plugin_lldb_quicklook/GITHUB-LLDB-QuickLook/LLDB-QuickLook/lldb_quick_look.py
command alias ql quicklook
The path to the py file was wrong so kept reporting the error:
error: 'ql' is not a valid command.
Once I fixed it. I had to restart Xcode 5 and it worked.
I didn't have to restart Mac.
I didn't have to make the file executable.