Binary being analyzed must exist, iOS App Archive in xcode - iphone

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.

Related

XCode 8.0, Building for Store Submission, Errors

Getting the following errors with XCODE 8.0. This was working fine with Xcode 7.x as far as we can remember.
ERROR ITMS-90087: "Unsupported Architectures. The executable for xxx.framework contains unsupported architectures '[x86_64, i386]'."
Does this mean that Apple is not smart enough not to include the simulator slice? We have to provide an SDK that has the simulator and does not?
ERROR ITMS-90209: "Invalid Segment Alignment. The app binary at 'XXX' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version."
But we are using the latest XCODE 8.0 version? What gives here?
ERROR ITMS-90125: "The binary is invalid. The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This binary does not seem to have been built with Apple's linker."
Not sure what this is. All Signing stuff is set correctly in all of the builds. Again, this was working fine before. We did use LIPO to make the universals. So maybe stripping the universals would do it????
WARNING ITMS-90080: "The executable 'Payload/mediumSDKSwift.app/Frameworks/VRSDK.framework' is not a Position Independent Executable. Please ensure that your build settings are configured to create PIE executables. For more information refer to Technical Q&A QA1788 - Building a Position Independent Executable in the iOS Developer Library."
All PIE stuff was working find, no changes, etc. All are set to NO for Position Dependent. Have been doing some reading on this and some have solved by flipping bits? hmmmm.....
ERROR ITMS-90087: "Unsupported Architectures. The executable for xxx.framework contains unsupported architectures '[x86_64, i386]'."
This is a known Apple bug.
Your other errors are resulting of manipulating an already signed product, so you have to code sign your product again after you sliced out the unsupported architectures.
Workaround:
The Carthage installer comes with a handy script, which I am using as an easy workaround.
1) Install Carthage
2) Add Build Phase Script
From Carthage site:
On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script in which you specify your shell (ex: bin/sh), add the following contents to the script area below the shell:
/usr/local/bin/carthage copy-frameworks
and add the paths to the frameworks you want to use under “Input Files”, e.g.:
$(SRCROOT)/Carthage/Build/iOS/Box.framework
$(SRCROOT)/Carthage/Build/iOS/Result.framework
...
Turns out we were providing a Universal Framework by mistake. Once this was solved all of the errors were solved.

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.

Application Failed Codesign Warning when Archiving [duplicate]

I am very new to iOS development, I have an app all set and ready to be distributed, but I seem to get this error every single time I run the application on my DEVICE only, the iOS simulator works just fine. Heres the full error:
Application failed codesign verification. The signature was invalid, contains disallowed entitlements, or it was not signed with an iPhone Distribution Certificate. (-19011)
Here's the entire log:
Validate "/Users/masonsocha/Library/Developer/Xcode/DerivedData/Multibrowser-brgeiknbjgrywwehhohafjwxjqnk/Build/Products/App Store-iphoneos/Multibrowser.app"
cd /Users/masonsocha/Desktop/Apps/MultiBrowser
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
setenv PRODUCT_TYPE com.apple.product-type.application
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/Validation "/Users/masonsocha/Library/Developer/Xcode/DerivedData/Multibrowser-brgeiknbjgrywwehhohafjwxjqnk/Build/Products/App Store-iphoneos/Multibrowser.app"
warning: Application failed codesign verification. The signature was invalid, contains disallowed entitlements, or it was not signed with an iPhone Distribution Certificate. (-19011)
Executable=/Users/masonsocha/Library/Developer/Xcode/DerivedData/Multibrowser-brgeiknbjgrywwehhohafjwxjqnk/Build/Products/App Store-iphoneos/Multibrowser.app/Multibrowser
codesign_wrapper-0.7.10: using Apple CA for profile evaluation
AssertMacros: trust_result == kSecTrustResultUnspecified, file: codesign_wrapper.c, line: 594
AssertMacros: profile, file: codesign_wrapper.c, line: 918
codesign_wrapper-0.7.10: Failed to load provision profile from: /Users/masonsocha/Library/Developer/Xcode/DerivedData/Multibrowser-brgeiknbjgrywwehhohafjwxjqnk/Build/Products/App Store-iphoneos/Multibrowser.app/embedded.mobileprovision
- (null)
I have already tried shortening the length of the project name, that did not help, I am currently using OSX Lion, on Xcode 4.3.2. I have spent all night pulling my hair out, please help!
May be xcode selects one of the development profile to sign the code with it.
Make sure it uses the distribution profile
press the project, in the Build Settings -> Code Signing section expand Code Signing Identity -> Release - > make sure that Any iOS SDK is referring to distribution profile.
I had the exact same issue..
Go to Keychain Access
Verify that you have your Public and Private keys set up correctly. This is a good reference https://developer.apple.com/legacy/library/technotes/tn2250/_index.html
I had previously adjusted my Keychain Certificate Preferences to make Outlook work but that pretty much screwed up XCode code signing..
After I set these to the "best attempt" setting (see screenshot) validation worked fine
You could solve it is not leaving the profile selection to xcode. Manually select the correct release profile in the project settings and it will go through.
I had same issue even after checking all signing stuff. I had the old "Can be debugged" setting in my entitlements file. Switching it to get-task-allowed fixed the problem. Apple has instructions on how to debug signing issues.
I had this problem but found that none of the above issues solved it. Eventually I found the solution by working through Apple's Technical Note (https://developer.apple.com/legacy/library/technotes/tn2250/_index.html) on the subject.
The specific problem in my case was an asset that was either missing or was hidden (I didn't find out which), but that wasn't flagged as a problem file anywhere else in the build process. I've outlined the steps I took to discover this below.
Archive the build, save for adhoc deployment.
Navigate to the ipa in finder, rename to .zip.
Double-click to unarchive, open the 'Payload' folder
Open a Terminal, and enter the following:
codesign --verify -vvvv -R='anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.1] exists and (certificate leaf[field.1.2.840.113635.100.6.1.2] exists or certificate leaf[field.1.2.840.113635.100.6.1.4] exists)' /Path/to/your/app.app
Instead of entering /Path/to/your/app.app, drag and drop the *.app file from the Payload folder into the terminal, ensure there's a space between the end of the command and the filename, and hit return.
I got an error in the output saying 'a sealed resource is missing or invalid', with the name of the file causing the problem (it began with a dot, which may have been the problem). When I searched for the filename in the XCode project browser I found the file, but when I looked in the Finder, it wasn't on disk.
The fix was simply to remove the file from the XCode project browser, and the error went away. I would definitely say to anyone getting a similar problem - work through Apple's tech notes. They're a bit badly worded but the solution is likely to be in there somewhere.
I had the same problem and solved it by:
Changing the Automatic Profile Selector value from "iPhone Developer" to "iPhone Distribution" according to section Assigning Provisioning Profiles to Build Configurations.
Download the Distribution Provisioning Profile and double-click on it in order to add it.

SQLCipher runs successfully with simulator but doesnt build

SQLCipher runs successfully with simulator but doesnt build with device; instead I get the following errors:
cp: libssl.a: No such file or directory
and
sqlite3.c:91838: internal compiler error: in find_src_set_src, at var-tracking.c:1922
I have followed the entire procedure given at SQLCIPHER website. And it runs successfully on simulator but when i change it to iOSDevice the above errors appears.
Kindly help me asap
Please make sure you are using the official 2.0 release from this repository, https://github.com/sqlcipher/sqlcipher, It addresses an issue building for armv6.
Open openssl.xcodeproj and follow instructions form this site:
http://programmer-in-paradise.blogspot.com/2011/07/how-to-build-openssl-in-xcode.html
You need to setup a new target then bring libssl.a in your project.
If you still have problems:
As XCode 4.3(2) complains in release and test on device (not in simulator) about arm 6, better is to compile your own openssl libraries [see http://www.x2on.de/2010/07/13/tutorial-iphone-app-with-compiled-openssl-1-0-0a-library/]. You just need to adjust some paths [like /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs, if you're familiar with scripting]. I managed to build libs for last version of OpenSSL [2012 openssl-1.0.1c], then include in my project and able to build release and archive for distribution, with encrypted db.

CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 4.2'

What does the following error mean;
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 4.2'
I only get the error when trying to test on device..
How to fix this?
#hmthur: You would find your solution in either of these links.
These are the links you can refer to as they too discuss the same problem as you have.
http://davidbits.blogspot.com/2010/11/codesign-error-code-signing-is-required.html
and
http://forums.macrumors.com/showthread.php?t=1061459
As far as I know, it is something to do with setting your active executable as Simulator and not device if you don't have developer license.
Also in some cases it is the problem with the code signing identity as discussed in one the links above.
Hope this helps you.
Make sure you have Targets (not Project) selected when you are editing Build Settings - Code Signing. Then under Debug, all of the options must be set to the Provisioning Profile for your particular bundle identifier, and under Release all of the options must be set to the Distribution profile of your particular bundle identifier.
If you run xcodebuild from a Build Phase Run Script or Pre- or Post action in the schemes in another target, and you copy the environment variables, this problem might occur also.
To fix this, run xcodebuild without the environment variables like so:
/usr/bin/env -i xcodebuild <xcodebuild arguments>
Compiling and running a target during the build phase of another target is used when a coredata store needs to be prefilled before archiving.