Announcement

Collapse
No announcement yet.

iOS Provisioning/Code Signing Issue Fix

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    iOS Provisioning/Code Signing Issue Fix

    Due to changes made by Apple recently to some of the files you need to download for setting up provisioning and code signing for iOS devices, people just starting or who have recently added a device or renewed an expired certificate may run into issues or receive errors such as "Data written is smaller than expected, unable to finish signing process" during the process.

    The fix for this is to use the iPhonePackager.exe application from the August 2011 UDK. If you have upgraded to the August 2011 UDK already or plan to, you don't need to do anything additional as that will solve the issue. If you are using an older build and wish to continue using it, you can download the August 2011 UDK, install it, and copy the iPhonePackager.exe file in its Binaries directory to your UDK version's Binaries directory, overwriting the old version.

    This new version will work with older provisioning files as well so there is no need to download new files.

    If you continue having issues, please post here so we can help you remedy them.

    #2
    I am using the May version and I am in the process of (trying) to upload my app. (yay...)

    I received this error when trying to upload my game using the Application Loader using a .ipa created from the May versions Frontend and its application settings:

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

    I then went through the process of setting up a new provision file .cer and .p12 file; got the same error, when I tried again.

    That lead me to this thread where I downloaded the August version of UDK and installed it. I then copied the iPhonePackager.exe to the May versions binary folder and ran it. I included my new provision .cer and .p12 and got this error inside the iPhonePackage program (The top of the error window is labled: Unreal iOS Configeration):

    "Failed to load or install certificate do to an error: 'Could not load file or assembly 'BouncyCastle.Crypto, Version=1.6.1.0, Culture=neutral, PublicKeyToken=0e99375e5469942' or one of its dependencies. The system cannot find the file specified.'"


    To sum this up: The May version Frontend accepts the provision, .cer and .p12 and allows me to cook and package the game. Only when I try to upload it does the Application Loader Error. The iPhonePackager.exe will not accept the .cer or .p12. (the error didn't mention the provision but I guess it can have an issue as well.)


    --- UPDATE ---

    The reason the iPhonePackager.exe sent its error is because I opened it directly and tried to import the new .cer and .p12 -- I also had it in the wrong directory. (The binary directory, not Binary -> iPhone directory)

    I copied the new iPhone folder (with iPhonePackager.exe) from the August release and re-packaged the game and tried again to upload it via the Application Loader but I am still getting the codesign verification failure.

    --- SECOND UPDATE ---

    I realized I was using the development certs and provision so I downloaded the Distribution ones and imported them into UDK via front end. Re-packaged game and tried to upload it again. I am still getting the Codesign verification failure...

    I'm honestly baffled at this point and giving up until the morning.

    Any help would be greatly appreciated.

    Comment


      #3
      Hi Vawx,

      So to verify, you are packaging a Shipping configuration using the 'Distribution' setting in UFE (make sure you have changed the Packaging Mode setting from 'Default' to 'Distribution'), and have installed a distribution certificate and mobile provision from the provisioning portal?

      If so, the line printed out from UFE at the start of the packaging step should look something like:
      Executing iPhonePackager RepackageIPA UDKGame Shipping -interactive -compress=best -sign -distribution


      Also verify the cert is installed correctly, go to Application Settings..Provision and Certificate Tools, and make sure you have two provisions listed,and both have a 'matching cert' line.

      Cheers,
      Michael Noland

      Comment


        #4
        Originally posted by joat View Post
        Hi Vawx,

        So to verify, you are packaging a Shipping configuration using the 'Distribution' setting in UFE (make sure you have changed the Packaging Mode setting from 'Default' to 'Distribution'), and have installed a distribution certificate and mobile provision from the provisioning portal?

        If so, the line printed out from UFE at the start of the packaging step should look something like:
        Executing iPhonePackager RepackageIPA UDKGame Shipping -interactive -compress=best -sign -distribution


        Also verify the cert is installed correctly, go to Application Settings..Provision and Certificate Tools, and make sure you have two provisions listed,and both have a 'matching cert' line.

        Cheers,
        Michael Noland
        Thanks for the reply Michael.

        Here is an image to what my settings are and how front end looks and what it does. The red error at the bottom of the image is new to yesterdays stuff.



        What I have done since last night:

        I have re-installed Mays version and imported my game files into the newly installed directory. I re-did the provisions, .cer and .p12 file inside the newly installed May Frontend. I copied the iPhonePackger.exe from the August version into the Binary -> iPhone directory, replacing the old one. Trying to cook the game from here sends an error saying it cant find "MobileGame-IPhone-Shipping.stub". I have tried both replacing the "MobileGame-IPhoneOS-Shipping.stub" to "MobileGame-IPhone-Shipping.stub" from the August version and I have tried renaming that file from the May version to "MobileGame-IPhone-Shipping.stub" from "MobileGame-IPhoneOS-Shipping". Either way, the game will cook (I followed the instructions on the UDN site). But, at the end of that, I get the red error inside of the image posted. -- the .ipa is always in the iPhone directory, even with the error but still gets the error trying to upload via the Application Loader.

        Also, the Bundle ID in the .plist matches the games Bundle ID in iTunes Connect. And, I would like to ask, just to be certain, is the CFBundleName supposed to match anything inside of the Provisioning center?

        Comment


          #5
          Hi Vawx,

          You probably won't be able to use the August stubs with code/content from a May UDK, since that spans the MobileGame->UDKGame merge (as well as some minor renames like IPhoneOS -> IPhone).

          Packaging in the May UDK using the May stubs renamed, with the August IPP dropped in might work but we've certainly never tested it.

          The final red message isn't the first error. There would have been a previous error that caused IPP to return a non-zero value and UFE to print out the failed message.

          Have you tried submitting a Shipping+Distribution build to the app store yet, and if so, what was the error message that you got there (and did it come from the application uploader, or later on from the submission website)?
          (The original post was from when you were testing a non-Distribution build right?)

          Cheers,
          Michael Noland

          Comment


            #6
            Originally posted by joat View Post
            Hi Vawx,

            You probably won't be able to use the August stubs with code/content from a May UDK, since that spans the MobileGame->UDKGame merge (as well as some minor renames like IPhoneOS -> IPhone).

            Packaging in the May UDK using the May stubs renamed, with the August IPP dropped in might work but we've certainly never tested it.

            The final red message isn't the first error. There would have been a previous error that caused IPP to return a non-zero value and UFE to print out the failed message.

            Have you tried submitting a Shipping+Distribution build to the app store yet, and if so, what was the error message that you got there (and did it come from the application uploader, or later on from the submission website)?
            (The original post was from when you were testing a non-Distribution build right?)

            Cheers,
            Michael Noland
            This entire process is trying to submit my game for Distribution. (To put it on the App store)

            The error I get from the Application Loader is: "Application failed codesign verification. The signature was invalid, or it was not signed with an iPhone Distribution Certificate."

            I am using a Distribution provision, distribution .cer, and distribution .p12 from my Provision portal. The Frontend settings are set to Distribution (not default) and have the same settings as what is on the UDN site instructions. (http://udn.epicgames.com/Three/Distr...ribution%20IPA

            The bundle identifier in the .plist matches the id from my iTunes connect page; the one for this game.


            As for the other error (like the one posted in red, in the image), it is as follows:

            IPP ERROR: Source folder does not exist: C:\UDK\UDK-2011-05 RushforIpad\MobileGame\CookedIPhone\...\...\Engine \Shaders\Mobile


            ---- UPDATE ----

            I wanted to try to cook the game with the May version only (no August iPhonePackager.exe). -- The error above doesn't happen when using the May version iPhonePackager.exe

            The default build works fine and I am able to test on my iPad by saving the .ipa and dragging / dropping it into iTunes, then syncing. I changed to the distribution setting and packaged the game and tried to upload this one. It is still giving me the same error "Application failed codesign verification. The signature was invalid, or it was not signed with an iPhone Distribution Certificate."

            Also, just to check to see if the Distribution .ipa was in fact a Distribution file, I tried to sync it to my iPad; it sent an error giving me the impression it is in fact a Distribution file. Not a Development .ipa.

            Here is an image of my Provisions and Certs window from Frontend so you can see that I do have a Distribution cert:



            The Application Loader error:



            Just because it could be related, I am using:

            Application Loader version: 2.4.1 (187)
            Keychain Access version: 4.1.1 (55004)
            XCode version: 4.2 Build 4C151a


            --- FINAL UPDATE ----

            I got it to work and here is why I had such a hard time.

            The first build I packaged had the Developer provision, cer and .p12 so it sent me the "Application failed codesign verification. The signature was invalid, or it was not signed with an iPhone Distribution Certificate." error.

            I then came here to search for a codesign verification error and came across this thread. I then thought I needed to use the August version of the iPhonePackager.exe to package my game without an error. After I discovered I was using the Developer signatures, I changed to to the Distribution ones but was getting the IPP error with the August version.

            Finally, I figured I'll just start from the beginning, using only the May version. I re made the provision, cer and .p12 and imported them into Front ended and packaged the game again.

            It is now uploading and looks like it'll be fine.

            Thanks for the help Michael

            Comment


              #7
              Hi Vawx,

              Glad that you got it sorted out without having to port everything to August.

              The August IPP fix is for people experiencing the 'Data written is smaller than expected, unable to finish signing process' error, but it looks like it's not safe to drop that IPP into substantially older builds (change in the shader directory, etc...), they'll have to upgrade to August instead.

              Cheers,
              Michael Noland

              Comment


                #8
                Hey there! I was one of the folks getting the 'Data Smaller' error, so I upgraded to the August build and now I am getting a new error that I just can't seem to figure out... Hoping some help can be provided here.

                Here is the error I am receiving.


                Install \ Update of "UDKGame-IPhone-Release.ipa" failed with There is a problem with the entitlements for this application (0xE8008016) in 21.04 seconds
                IPP ERROR: Failed to install IPA on device

                Program exited with return code 100


                This is after I created an entirely new Certificate through the iOS Dev Portal site.

                Thank you kindly!

                Comment


                  #9
                  Any help would be greatly appreciated. Thanks!

                  Comment


                    #10
                    So, it has been a little over two weeks and I am still getting this issue. *shrug* I really don't know what I should do.

                    As further update it stops at

                    ... Install is 40% complete at phase 'InstallingEmbeddedProfile'

                    and then gives the error noted in my previous post.

                    Comment


                      #11
                      I am about to upload to Apple too, and I'm using May version for my game, does this mean it will not work ?
                      use the iPhonePackager.exe application from the August 2011 UDK
                      So is that method good or not?
                      Thanks!
                      edit: I decided to not even try with May and port to later version first ...

                      Comment


                        #12
                        Originally posted by ffejnosliw View Post
                        Due to changes made by Apple recently to some of the files you need to download for setting up provisioning and code signing for iOS devices, people just starting or who have recently added a device or renewed an expired certificate may run into issues or receive errors such as "Data written is smaller than expected, unable to finish signing process" during the process.

                        The fix for this is to use the iPhonePackager.exe application from the August 2011 UDK. If you have upgraded to the August 2011 UDK already or plan to, you don't need to do anything additional as that will solve the issue. If you are using an older build and wish to continue using it, you can download the August 2011 UDK, install it, and copy the iPhonePackager.exe file in its Binaries directory to your UDK version's Binaries directory, overwriting the old version.

                        This new version will work with older provisioning files as well so there is no need to download new files.

                        If you continue having issues, please post here so we can help you remedy them.

                        I'm getting this error now Jeff in the September 2011 build...Could it be the iphone packager or the other reason bellow?

                        'Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate'

                        Now the only thing I did that wasn't clear on the UDN was to use the same key developer key pair for development when I requested the distribution certificate..
                        Do I need a different key pair for the development and distribution certificates?



                        Seek And Destroy Games
                        Tutorials for UDK PC,iOS and 3ds Max
                        http://www.youtube.com/user/lexluthornumber1

                        Comment


                          #13
                          Hey, I submitted the game with September 2011 build!
                          I had similar problems at first, cause my development and distribution certificates didn't match up!
                          Once I rechecked everything, in iOS license settings, both showed up in same list (like on UDN page example)!
                          Then it worked fine!

                          Comment


                            #14
                            Originally posted by Jurij View Post
                            Hey, I submitted the game with September 2011 build!
                            I had similar problems at first, cause my development and distribution certificates didn't match up!
                            Once I rechecked everything, in iOS license settings, both showed up in same list (like on UDN page example)!
                            Then it worked fine!
                            That's just your info plist settings were wrong and nothing to do with code signing...


                            Seek And Destroy Games
                            Tutorials for UDK PC,iOS and 3ds Max
                            http://www.youtube.com/user/lexluthornumber1

                            Comment


                              #15
                              That's just your info plist settings were wrong and nothing to do with code signing...
                              No the problem was I had my development profiling was set up differently than the distribution one
                              as I renamed the game just before I finished it,
                              therefore a lot of settings changed and I didn't thought development settings matter,thats why I got similar error as you get :
                              'Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate'
                              Click image for larger version

Name:	ScreenShot405.jpg
Views:	1
Size:	15.4 KB
ID:	3248674
                              And this is what I meant how it has to look:
                              Click image for larger version

Name:	ScreenShot404.jpg
Views:	1
Size:	46.5 KB
ID:	3248675

                              Comment

                              Working...
                              X