0

This is my first app being submitted to the app store, and I did everything according to the apple guide, but when I finally tried to build with the distribution configuration, I get one error and one warning. This is my build log of the error and warning, and I was wondering if anyone could tell me what is going on here.

warning: Application failed codesign verification.  The signature was invalid, or it was not signed with an Apple submission certificate. (-19011)
failed to extract requirements data: 1
/Users/xxxx/Desktop/xxxx/build/Distribution-iphoneos/xxxxx.app: object file format invalid or unsuitable
failed to extract entitlements: 1
 - (null)

Also,

    /Users/xxxxxx/Desktop/xxxxx/build/Distribution-iphoneos/xxxxxxx.app: object file format invalid or unsuitable
Command /usr/bin/codesign failed with exit code 1

What is going on?

Regan
  • 1,487
  • 2
  • 28
  • 43

2 Answers2

0

You have to make sure the right certificate is selected in your build settings. For each configuration profile you have different settings. So if you use "Release" as your AppStore build then you must go to your project settings and set the "Code Sign Identity" to the right developer certificate.

And do the same for the target, I think thats why you got these error messages.

0

Regarding the error: … *.app: object file format invalid or unsuitable

  1. Changes to the "Executable file" (aka, CFBundleExecutable) Info.plist setting to something different from the Product Name build setting can trip this error. The quick fix in this case is to restore your "Executable file" Info.plist property to the following value: ${EXECUTABLE_NAME} . The reason this occurs is because the executable name is derived by Xcode of the values for the PRODUCT_NAME, EXECUTABLE_PREFIX, and EXECUTABLE_SUFFIX build settings and Xcode validates/insists this format after packing the app. Often times (and by default) the EXECUTABLE_PREFIX and EXECUTABLE_SUFFIX are empty so the executable name in turn matches the Product Name. Therefore setting the "Executable file" info.plist setting equal to the value of the Product Name build setting will technically work (so long as the executable prefix and suffix build settings remain blank), but restoring its value to ${EXECUTABLE_NAME} is best.

  2. Another cause of this error is due to malformed Code Signing related Build Settings on the Xcode Project, or Code Signing settings which vary slightly the recommended settings. You can use the following guide to ensure your Project and Keychain satisfy all the requirements for code signing and take special note of the Figures to check that your settings match what's recommended by Apple exactly. The following recommended sections are referenced from the guide: "Understanding and Resolving Code Signing Issues" Specifically, see the sections: "Verify Keychain configuration" and "Verify Xcode Project configuration".

If the error persists after the above, the problem is likely Xcode Project specific versus an inherent problem with your signing Identities. Therefore, I recommend creating a new Xcode Project with your current version of Xcode and migrate your existing code, resources, and frameworks into the new project and see if the code sign error persists.

Good luck,

Bobjt
  • 4,040
  • 1
  • 29
  • 29