6 Replies Latest reply: Feb 2, 2012 8:24 PM by cmk7 RSS

    Can't sign AIR application so it can be uploaded to Apple

    Doubledutch20 Community Member

      This should have been the easy bit.... Having spend weeks developing an AIR application (using a developer certificate) the big day arrived to upload the App to the AppStore for review. That was Sunday everning (48 hours ago) and since then I've been trying to get my App passed the "Apple Application Loader" with out any luck. I normally work on a Windows machine but have also tried the Mac Key Chain approach without any luck so here is my cry for help. So the steps I followed  are:


      • Download XCode to my Mac
      • Use CS5.5 on my PC
      • Develop application with AIR for IOS / ActionScript 3.0
      • Follow these instructions: http://help.adobe.com/en_US/air/build/WS5b3ccc516d4fbf351e63e3d118666ade46-7ff0.html - in summary - using SSL installed on a Ubuntu 10.04 box
        • "openssl genrsa -out mykey.key 2048"
        • "openssl req -new -key mykey.key -out CertificateSigningRequest.certSigningRequest  -subj "/emailAddress=[MY_APPLE_EMAIL], CN=[MY_NAME], C=US"
        • Upload: CertificateSigningRequest.certSigningRequest as my Distribution Key to my iOS Provisioning portal
        • Download the "Distribution certificate" to my Ubuntu server (I don't seem to have a use for the WWDR file - should I use that somehow?)
        • Convert the Distribution certificate to a PEM file using: openssl x509 -in distribution_identity.cer -inform DER -out distribution_identity.pem -outform PEM
        • Convert PEM to a P12 file: openssl pkcs12 -export -inkey mykey.key -in distribution_identity.pem -out iphone_dist.p12
        • Create a new distribution profile on iOS developer site using this new distribution certificate and download it
      • In CS5.5 - Publishing profile - Player Development settings
        • use iphone_dist.p12 as the development certificate
        • use the downloaded distribution profile as the provisioning profile
        • Set the deployment type to "Apple App Store"
      • Publish

      I get a nice and shiny ipa file which I then put on my mac and try to upload it using Application Loader which rejects it with:


      Application failed codesign verification. The signature was invalid, or it was not signed with an iPhone Distribution Certificate


      I've tried to regenerate everything about 20 times now on Mac and Windows but always with the same result. Any suggestions would be greatly appreciated.

        • 1. Re: Can't sign AIR application so it can be uploaded to Apple
          iBr3nt Community Member

          Welcome to the wonderful world of Apple signing.


          Is there any way you could do all the code signing on the Mac? It's

          going to be challenging to decipher what the problem is using the method

          you outlined below.


          The only thing I can suggest is to make absolutely sure that you're

          using Distribution provisioning profiles along with the matching

          Distribution cert. I've created a number of tutorials showing the

          process for creating Distribution profile/certs here:



          It could be in the way the cert is created with openssl, hard to tell

          for sure.



          • 2. Re: Can't sign AIR application so it can be uploaded to Apple
            Doubledutch20 Community Member

            "Welcome to the wonderful world of Apple signing" never seen anything like it - it's a wonder that any Aps end up in the AppStore.


            I'll go through your tutorials today and start afresh from my mac but in the mean time could you / someone clarify a few points for me:


            • When I create the Signing request: how critical are the email address and Common name. E.g. do they have to be identical to those I used to configure my account (or something else...) in developer.apple.com?
            • The P12 file - is that specific to AIR signing or does the normal XCode packager (or whatever that's called...) use an identical mechanism
            • I am utterly confused about this WWDR intermediate file. At which stage should I import it into my key chain: before, after which step


            I thought writing good Aps was the tricky bit!





            • 3. Re: Can't sign AIR application so it can be uploaded to Apple
              Doubledutch20 Community Member

              3 Days later - I figured it out and for the  rest of the world who will ever try to do the same thing:


              • I use CS5.5 to develop my Apps which comes with AIR 2.6
              • Air 2.6 runs like a (slow) dog on iPhones so I installed AIR 3.1 and I created a seperate XML / and windows Batch file to compile to AIR 3.1
              • That Batch file include an <ID> tag which was just a tiny little bit different to the one specified in iOS Developer Portal / iTunes Connect - and that breaks the verification process in App Loader


              So moral of the story is: Make sure that


              iTunes Connect Bundle ID = iOS Developer AppID (without the first 10 or so digits) = CS5.5 Publish Setting - Deployment - AppID


              Or loose lots of sleep :-)

              • 4. Re: Can't sign AIR application so it can be uploaded to Apple

                Hi iBrent,


                I've spent many hours creating and revoking certificates today because I couldn't upload to the App store through application loader. The ipa distribution files always installed to my iPad but would not be accepted for review. Finally, I came across this post and followed your video tutorials. I can't believe it but this time my app uploaded. Here's my question. Since uploading the app, I decided to test the app once again on my iPad with the new certs and provisioning profiles. I was able to get the app onto my device using the development cert and profile but NOT with the distribution cert and profile. Now I'm worried that the app I uploaded will have a problem. Do you know why an app would be accepted for review but not be able to install onto my device? It's weird that all of the earlier failed distribution apps would install to my iPad but didn't pass application loader. Any thoughts?




                • 5. Re: Can't sign AIR application so it can be uploaded to Apple
                  iBr3nt Community Member

                  Hi Colleen,


                  When you sign an app for distribution you can't easily install on your

                  device to test with. Technically you can go through a commandline

                  process with Xcode tools to get it to install, but once it's signed for

                  distribution, don't worry that it doesn't install. If you've tested the

                  app with the developer signing, and everything works as planned, then

                  the final app should be fine. Besides, Apple will certainly tell you is

                  something isn't right with your app.


                  Good luck!



                  • 6. Re: Can't sign AIR application so it can be uploaded to Apple
                    cmk7 Community Member

                    Thank you so much! I suppose I can stop worrying and get some sleep tonight. What an ordeal!


                    Your videos are terrific. I can't thank you enough.