0 Replies Latest reply: Nov 3, 2014 3:27 AM by ActivelyX RSS

    Solution to ERROR ITMS-9000: "Invalid Code Signing."

    ActivelyX Community Member

      I am using FlexSDK 4.13 and AIR SDK 15.0.302. I installed the FlexSDK and AIR SDK with the Apache Flex installation binary on a Windows Vista 64-bit machine.

       

      I can build and run an ad-hoc version of my iOS app on an iPhone 4 (iOS 8.0.2) and iPad 2 (iOS 8.1). When I build a release version for the iTunes App Store, and submit it with the Xcode Application Loader. I get the error.

       

      ERROR ITMS-9000: "Invalid Code Signing. The executable, Payload/YourApp.app/YourApp, must be signed with the certificate that is contained in the provisioning profile."

       

      I'm using a Mac to submit my app. It is running OS X 10.10 Yosemite and Xcode version 6.1. The Application Loader is version 3.0.

       

      I suspect that the adt command no longer creates a payload with the correct entitlements. This post illustrates how I resigned my app so that the iTunes App Store would accept it.

       

      First, I copied my IPA file to my iMac. Then I changed directories to the location of my IPA file.

       

      Open a text editor and create a file with the name, entitlements.plist.

       

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

      <plist version="1.0">

      <dict>

      <key>application-identifier</key>

      <string>XAXAXAXAXA.com.yourapp.yourappmobile</string>

      <key>get-task-allow</key>

      <false/>

      <key>keychain-access-groups</key>

      <array>

      <string>XAXAXAXAXA.com.yourapp.yourappmobile</string>

      </array>

      </dict>

      </plist>

       

      Save this file.

       

      Start a terminal session. Then type in the following commands.

       

      unzip YourApp-app-store.ipa

       

      cp ~/Downloads/YourApp.mobileprovision Payload/YourApp.app/embedded.mobileprovision

       

      codesign -f -s "iPhone Distribution: YOUR COMPANY NAME (XAXAXAXAXA)" --entitlements Payload/YourApp.app/entitlements.plist Payload/YourApp.app

       

      zip -qry YourApp-resigned.ipa Payload/

       

      Note that codesign uses the full key name of your code signing certificate.

       

      Now you can submit YourApp-resigned.ipa to the iTunes App Store.

       

      I've seen some people have success with the iReSign App, which you can find at the following URL. I prefer the command line.

       

      https://github.com/maciekish/iReSign