Monday, April 16, 2012

What can cause "invalid binary” with no email followup from iTunes Connect?


I'm trying to submit an update of an existing application on behalf of one of my clients, and I'm getting "Invalid Binary" failures from iTunes Connect with no explanation of the error. I'm leaving on a 2 week vacation without network access tomorrow, so I'm a bit desperate for a solution. Any insights are greatly appreciated.



This update changes the name of the application and fixes a few minor bugs. I did previous submissions via the iTunes Connect, but I'm submitting this update via Xcode as Apple now requires.



I set myself up as the technical contact for this client, so I receive a notification when I put the new version into a "Waiting for Upload" state via iTunes Connect. When I then validate the binary via the Xcode organizer, the tool eventually reports that the binary is valid. When I submit the binary via the Xcode organizer, it eventually comes back and says that the binary has been successfully uploaded. Both of these steps take a while (maybe 15 minutes each), probably because the app bundle is 63 megabytes with thousands of resources.



For the next hour or two the iTunes Connect portal still reports that the application is in a "Waiting for Upload" state. I believe some latency is normal between the time when the upload completes in Xcode and when the state changes in iTunes Connect. These hours of latency seem excessive, but not entirely surprising I suppose, given the size of the app.



Eventually the state just silently changes to "Invalid Binary" in iTunes connect. I understand that iTunes Connect is supposed to send out an email explaining the error when this happens, but I'm not receiving anything, nor is my client. (I assume it should go out to all users flagged for notification of app state changes in iTunes Connect. Is this assumption correct?)



Here are the build settings copied and pasted from my App Store Distribution configuration:




ADDITIONAL_SDKS =
ARCHS = $(ARCHS_STANDARD_32_BIT)
SDKROOT = iphoneos4.0
ONLY_ACTIVE_ARCH = YES
VALID_ARCHS = armv6 armv7
SYMROOT = /Users/cduhn/Documents/workspace/xcode_build_output
OBJROOT = $(SYMROOT)
CONFIGURATION_BUILD_DIR = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
CONFIGURATION_TEMP_DIR = $(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
SHARED_PRECOMPS_DIR = $(CACHE_ROOT)/SharedPrecompiledHeaders
BUILD_VARIANTS = normal
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
ENABLE_OPENMP_SUPPORT = NO
GENERATE_PROFILING_CODE = NO
PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = YES
RUN_CLANG_STATIC_ANALYZER = NO
SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = NO
VALIDATE_PRODUCT = NO
CODE_SIGN_ENTITLEMENTS = Entitlements.plist
CODE_SIGN_IDENTITY =
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution: Capturing Moments
CODE_SIGN_RESOURCE_RULES_PATH =
OTHER_CODE_SIGN_FLAGS =
STRIPFLAGS =
ALTERNATE_GROUP = $(INSTALL_GROUP)
ALTERNATE_OWNER = $(INSTALL_OWNER)
ALTERNATE_MODE = $(INSTALL_MODE_FLAG)
ALTERNATE_PERMISSIONS_FILES =
DEPLOYMENT_LOCATION = NO
DEPLOYMENT_POSTPROCESSING = NO
INSTALL_GROUP = $(GROUP)
INSTALL_OWNER = $(USER)
INSTALL_MODE_FLAG = u+w,go-w,a+rX
DSTROOT = /tmp/$(PROJECT_NAME).dst
INSTALL_PATH = $(HOME)/Applications
MACOSX_DEPLOYMENT_TARGET = $(inherited)
SKIP_INSTALL = YES
COPY_PHASE_STRIP = YES
STRIP_INSTALLED_PRODUCT =
STRIP_STYLE = all
TARGETED_DEVICE_FAMILY = 1
SEPARATE_STRIP = NO
IPHONEOS_DEPLOYMENT_TARGET = 3.0
MODULE_NAME =
MODULE_START =
MODULE_STOP =
MODULE_VERSION =
BUNDLE_LOADER =
STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = dynamic
DYLIB_COMPATIBILITY_VERSION =
DYLIB_CURRENT_VERSION =
LINKER_DISPLAYS_MANGLED_NAMES = NO
PRESERVE_DEAD_CODE_INITS_AND_TERMS = NO
LD_DYLIB_INSTALL_NAME =
EXPORTED_SYMBOLS_FILE =
INIT_ROUTINE =
LINK_WITH_STANDARD_LIBRARIES = YES
MACH_O_TYPE = mh_execute
LD_OPENMP_FLAGS = -fopenmp
ORDER_FILE =
OTHER_LDFLAGS = -all_load -ObjC
LD_MAP_FILE_PATH = $(TARGET_TEMP_DIR)/$(PRODUCT_NAME)-LinkMap-$(CURRENT_VARIANT)-$(CURRENT_ARCH).txt
GENERATE_MASTER_OBJECT_FILE = NO
PREBINDING = NO
PRELINK_LIBS =
KEEP_PRIVATE_EXTERNS = NO
LD_RUNPATH_SEARCH_PATHS =
SEPARATE_SYMBOL_EDIT = NO
PRELINK_FLAGS =
SECTORDER_FLAGS =
UNEXPORTED_SYMBOLS_FILE =
WARNING_LDFLAGS =
LD_GENERATE_MAP_FILE = NO
COMPRESS_PNG_FILES = YES
APPLY_RULES_IN_COPY_FILES = NO
EXECUTABLE_EXTENSION =
EXECUTABLE_PREFIX =
INFOPLIST_EXPAND_BUILD_SETTINGS = YES
GENERATE_PKGINFO_FILE = YES
FRAMEWORK_VERSION = A
INFOPLIST_FILE = iRevealMaui-Info.plist
INFOPLIST_OTHER_PREPROCESSOR_FLAGS =
INFOPLIST_OUTPUT_FORMAT = binary
INFOPLIST_PREPROCESSOR_DEFINITIONS =
INFOPLIST_PREFIX_HEADER =
INFOPLIST_PREPROCESS = NO
COPYING_PRESERVES_HFS_DATA = NO
PRIVATE_HEADERS_FOLDER_PATH = $(CONTENTS_FOLDER_PATH)/PrivateHeaders
PRODUCT_NAME = iRevealMaui
PLIST_FILE_OUTPUT_FORMAT = binary
PUBLIC_HEADERS_FOLDER_PATH = $(CONTENTS_FOLDER_PATH)/Headers
STRINGS_FILE_OUTPUT_ENCODING = binary
WRAPPER_EXTENSION = app
ALWAYS_SEARCH_USER_PATHS = NO
FRAMEWORK_SEARCH_PATHS =
HEADER_SEARCH_PATHS = ${SDKROOT}/usr/include/libxml2/** ../three20/Build/Products/three20
LIBRARY_SEARCH_PATHS = $(inherited) "$(SRCROOT)/../desiccant/Classes/External/google-analytics"
REZ_SEARCH_PATHS =
EXCLUDED_RECURSIVE_SEARCH_PATH_SUBDIRECTORIES = *.nib *.lproj *.framework *.gch (*) CVS .svn *.xcodeproj *.xcode *.pbproj *.pbxproj
INCLUDED_RECURSIVE_SEARCH_PATH_SUBDIRECTORIES =
OTHER_TEST_FLAGS =
TEST_HOST =
TEST_RIG =
CURRENT_PROJECT_VERSION =
VERSION_INFO_FILE = $(PRODUCT_NAME)_vers.c
VERSION_INFO_EXPORT_DECL =
VERSION_INFO_PREFIX =
VERSION_INFO_SUFFIX =
VERSIONING_SYSTEM =
VERSION_INFO_BUILDER = $(USER)
GCC_FAST_OBJC_DISPATCH = YES
GCC_AUTO_VECTORIZATION = NO
GCC_OBJC_CALL_CXX_CDTORS = YES
GCC_ENABLE_SSE3_EXTENSIONS = NO
GCC_ENABLE_SSE41_EXTENSIONS = NO
GCC_ENABLE_SSE42_EXTENSIONS = NO
GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = NO
GCC_STRICT_ALIASING = NO
GCC_FEEDBACK_DIRECTED_OPTIMIZATION = Off
GCC_ENABLE_FIX_AND_CONTINUE = NO
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
GCC_DYNAMIC_NO_PIC = YES
GCC_GENERATE_TEST_COVERAGE_FILES = NO
GCC_INLINES_ARE_PRIVATE_EXTERN = YES
GCC_MODEL_TUNING = G4
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO
GCC_ENABLE_KERNEL_DEVELOPMENT = NO
GCC_DEBUGGING_SYMBOLS = default
GCC_REUSE_STRINGS = YES
GCC_NO_COMMON_BLOCKS = NO
GCC_ENABLE_OBJC_GC = unsupported
GCC_OPTIMIZATION_LEVEL = s
GCC_FAST_MATH = NO
GCC_ENABLE_SYMBOL_SEPARATION = YES
GCC_THREADSAFE_STATICS = YES
GCC_SYMBOLS_PRIVATE_EXTERN = YES
GCC_UNROLL_LOOPS = NO
GCC_MODEL_PPC64 = NO
GCC_CHAR_IS_UNSIGNED_CHAR = NO
GCC_ENABLE_ASM_KEYWORD = YES
GCC_C_LANGUAGE_STANDARD = c99
GCC_CHECK_RETURN_VALUE_OF_OPERATOR_NEW = NO
GCC_CW_ASM_SYNTAX = YES
GCC_INPUT_FILETYPE = automatic
GCC_ALTIVEC_EXTENSIONS = NO
GCC_ENABLE_CPP_EXCEPTIONS = YES
GCC_ENABLE_CPP_RTTI = YES
GCC_LINK_WITH_DYNAMIC_LIBRARIES = YES
GCC_ENABLE_OBJC_EXCEPTIONS = YES
GCC_ENABLE_TRIGRAPHS = NO
GCC_ENABLE_FLOATING_POINT_LIBRARY_CALLS = NO
GCC_USE_INDIRECT_FUNCTION_CALLS = NO
GCC_USE_REGISTER_FUNCTION_CALLS = NO
GCC_INCREASE_PRECOMPILED_HEADER_SHARING = NO
OTHER_CPLUSPLUSFLAGS = $(OTHER_CFLAGS)
GCC_PRECOMPILE_PREFIX_HEADER = YES
GCC_PREFIX_HEADER = iRevealMaui_Prefix.pch
GCC_ENABLE_BUILTIN_FUNCTIONS = YES
GCC_ENABLE_PASCAL_STRINGS = YES
GCC_FORCE_CPU_SUBTYPE_ALL = NO
GCC_SHORT_ENUMS = NO
GCC_ONE_BYTE_BOOL = NO
GCC_USE_STANDARD_INCLUDE_SEARCHING = YES
GCC_PREPROCESSOR_DEFINITIONS =
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS =
GCC_WARN_CHECK_SWITCH_STATEMENTS = NO
GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO
GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO
GCC_WARN_ABOUT_GLOBAL_CONSTRUCTORS = NO
GCC_WARN_SHADOW = NO
GCC_WARN_64_TO_32_BIT_CONVERSION = NO
GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES
GCC_WARN_INHIBIT_ALL_WARNINGS = NO
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = NO
GCC_WARN_ABOUT_RETURN_TYPE = YES
GCC_WARN_MISSING_PARENTHESES = NO
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = NO
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO
GCC_WARN_ABOUT_MISSING_NEWLINE = NO
GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = NO
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = NO
WARNING_CFLAGS =
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO
GCC_WARN_PEDANTIC = NO
GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES
GCC_WARN_PROTOTYPE_CONVERSION = NO
GCC_WARN_SIGN_COMPARE = NO
GCC_WARN_STRICT_SELECTOR_MATCH = NO
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = NO
GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = NO
GCC_TREAT_WARNINGS_AS_ERRORS = NO
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES
GCC_WARN_UNDECLARED_SELECTOR = NO
GCC_WARN_UNINITIALIZED_AUTOS = NO
GCC_WARN_UNKNOWN_PRAGMAS = NO
GCC_WARN_UNUSED_FUNCTION = NO
GCC_WARN_UNUSED_LABEL = NO
GCC_WARN_UNUSED_PARAMETER = NO
GCC_WARN_UNUSED_VALUE = NO
GCC_WARN_UNUSED_VARIABLE = YES
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES
GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = YES
IBC_FLATTEN_NIBS = YES
IBC_OTHER_FLAGS =
IBC_PLUGIN_SEARCH_PATHS =
IBC_PLUGINS =
IBC_ERRORS = YES
IBC_NOTICES = YES
IBC_WARNINGS = YES



Here are the contents of my Info.plist:






Any insights are greatly appreciated.



EDIT - Apparent status change latency explained



Based on my status history, it appears that the "Invalid Binary" status is actually being established within minutes, but iTunes Connect is concealing this fact with a poorly designed caching strategy.



To monitor for a change in state, I've been refreshing and clicking around between four pages: "Manage Your Applications", the "App Information" page, "View Details", and "Status History". When the status history finally updates, it shows that the app went into an "Invalid Binary" state around an hour prior.



As an experiment, I tried changing my app ID and submitting the binary as a new app. This time, I clicked into the "View Details" page a few minutes after submitting the binary. Its status showed, "Upload Received". Apparent progress! A couple minutes later I clicked into Status History, and it showed "Invalid Binary" mere minutes after my upload finished. Then I went back and refreshed my "View Details" page. It still shows "Upload Received", despite the fact that the Status History shows "Invalid Binary". This is pretty clear evidence that all these pages are being cached and showing stale data for long periods of time. I only caught this when I resubmitted the binary as a new app because I was loading the pages for that app for the first time.



This doesn't solve my "Invalid Binary" problem, nor does it explain why I'm not getting any emails, but it does help rule out some hypotheses.


Source: Tips4all

15 comments:

  1. Hey, after 16 hours of non stop research trial and error, and headbanging I have found a solution in apple developer's forum.

    Apparently there is a bug allowing your binary to pass verification and upload, but then to get rejected by iTunes Connect system. And you don't get any email explaining you what happened!

    If your App is for both iPhone and iPad, you probably have something like this in the Info.plist file:



    You should completely remove the CFBundleIconFiles~ipad parameter and include the iPad icon in the Icons files array instead like here:



    That's all folks!

    Let me know if that helped you!

    ReplyDelete
  2. Thanks to everyone who proposed solutions. As it turns out, none of your suggestions helped in my case, but I did solve the problem. Here's what worked for me:

    Delete Entitlements.plist from your project. Then do Add -> New File and re-add Entitlements.plist.

    The format of the Entitlements.plist changed between SDK 3.1.3 and 3.2. If your Entitlements.plist was created with an SDK earlier than 3.2, and you're now trying to update your app using SDK 3.2 or greater, it appears that you have to delete the Entitlements.plist and re-add it using the new format. Otherwise Apple will reject your upgrade as an "Invalid Binary".

    ReplyDelete
  3. I had the same INVALID BINARY error from iTunes Connect even if Application Loader accepted my binary. The solution was very simple...

    Open your info.plist, right-click and check Show Raw Key/Values:


    CFBundleIconFile = Icon.png (my iPhone 57x57 PNG icon)
    CFBundleIconFile~ipad = Icon-72.png (my ipad 72x72 PNG icon)
    CFBundleIconFiles = array

    Item 0 = Icon.png
    Item 1 = Icon@2x.png (my iPhone 4 114x114 PNG icon)
    Item 2 = Icon-72.png



    Save, clean all targets, build and analyze, compress in Finder and resubmit!

    The error was caused because I typed the key "Icon Files". In Raw view, this has mapped to "Icon Files" instead of CFBundleIconFiles. I have Xcode 3.2.3, I guess Xcode 3.2.4 better maps this key identifier.

    Good Luck everybody!

    Source: Technical Q&A QA1686: App Icons on iPad and iPhone

    ReplyDelete
  4. I've been having the same problem for a few days. It seems as though this error can be caused by so many different issues, so it's a shame Apple don't elaborate the error with an email.

    For me, the solution was to not use "Application Loader" at all!

    Instead do the following within Xcode:


    Select your application go to Build > Build & Archive
    Once this is complete, go to Window > Organizer
    Select your application under "Archived Applications"
    Click'Validate'
    If the validation is a success (as mine was):
    click 'Submit'.


    This will then submit the application to apple. For me, after a few seconds the status was changed to 'Waiting for review' rather than 'Invalid Binary'.

    ReplyDelete
  5. The trick of the IPad icon do work.

    Remove the CFBundledIconFiles~ipad and add a 72x72 icon to the Icon Files key

    Beware with the screenshots, this method sometimes, creates the Missing Screenshots Error

    ReplyDelete
  6. I've been struggling with the same problem for quite a while now. I discovered this morning that the team agent had all the notifications turned off, so I turned them all on and finally started getting state change emails when the app changed to "Waiting For Upload", but still nothing when the state changed to "Binary Invalid". After a few more attempts, I finally got the app update into the "Waiting For Review" state. What solved it for me was changing the value of "iPhone OS Deployment Target" in the target's build settings from iPhone OS 2.2.1 (the setting for the original app) to iPhone OS 3.0.

    ReplyDelete
  7. i had this problem. my issue turned out to be setting the deployment target to something less than 3.2, but having the architecture still set to 'optimized for armv7.' this is using xcode 3.2.3. the latter setting should be changed to 'standard (armv6 and armv7).' when i'd built my development app, i had to change it, because xcode complained when i tried to run the app on an older itouch, but with a distribution build there's no device to run on (unless you test with an ad hoc first), so you don't notice the problem until itunes connect rejects the binary.

    ReplyDelete
  8. I have the same problem. I tried the entitlements thing first, as it seemed like it fit my situation.

    Boy are they different:
    OLD entitlement plist:

    <plist version="1.0">
    <dict>
    <key>get-task-allow</key>
    <false/>
    </dict>




    New one... (xcode 3.2.5, 4.2 target and min iOS)

    <plist version="1.0">
    <dict>
    <!--- Required entitlements (in most cases shouldn't be changed) --->
    <key>application-identifier</key>
    <string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
    <key>keychain-access-groups</key>
    <array>
    <string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
    </array>

    <!--- Custom entitlements below --->


    </dict>
    </plist>

    ReplyDelete
  9. I struggled with this for half a day. Even tried reinstalling xcode. For me the answer was going back to the provisioning portal in itunes connect and revoking my certificate then making a new one. Then making a new distribution provisioning profile, then rebuilding and resubmitting. What a long undocumented pain in the neck.

    ReplyDelete
  10. This may be an issue of the following, which I received after a submission from an automated response from iTunesConnect:

    "Missing Push Notification Entitlement - Your app registers with the Apple Push Notification Service, but the application signature's entitlements do not include the required "aps-environment" entitlement. Make sure you have enabled Push Notification Services for this app, and that you have downloaded a Distribution provisioning profile that includes the "aps-environment" entitlement.

    Once you have corrected the issue, please return to the application's version details page in the iTunes Connect Manage Your Applications module and click on the Ready to Submit Binary button. This will take you through the binary submission flow and return your application version status to Waiting for Upload. You can then use Application Loader to upload your new binary. If any other issues are found with your submission you will be contacted."

    ReplyDelete
  11. In my case, I had generated provisioning profiles using a different CSR & not using the original CSR which was created the first time to access the provisioning portal. Code signing & submitting the apps with provisioning profiles generated of the original CSR resolved my issue.

    ReplyDelete
  12. I encountered same "invalid binary" issue for several times today. Finally I solved it by checking build messages in XCode 4. click show all messages for build log, find code sign and validate part, normally on the bottom. All of my failed submission has validation error in build log, but passed in archive - validate button.

    ReplyDelete
  13. Same problem, different solution: my archive scheme was using ad hoc build configuration, when it should have been release.

    Checklist for my failed fix attempts at my blog Application Failed Codesign Verification.

    ReplyDelete
  14. I had the same problem and it was apparently tied to the size of the Default startupscreen image shipped with the app.

    I was sending 1024x768 default image but I have find in this article :

    http://weston-fl.com/blog/?p=840/

    That it needs to be 1024x748 (for a landscape default)
    and I seems it worked : iTunesconnect took it after that.

    ReplyDelete
  15. In XCode, click on your app name on the left side and go to the build settings tab on the right side. Scroll down to "Code Signing Identity" -> "Release"

    Be sure that your distribution profile is selected. I didn't realize I had to explicitly set this and my app was verified just fine, but the binary invalid. My setting was still on the developer profile

    ReplyDelete