Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-45509

Xcode 9 requires provisioning profile to be specified when using manual code signing

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Blocker
    • Resolution: Unresolved
    • Component/s: xcode-plugin
    • Labels:
    • Environment:
      Xcode 9 (beta 2), xcodebuild plugin 2.0
    • Similar Issues:

      Description

      Since Xcode 9, builds that use manual code signing require that a provisioning profile is specified in the exportOptions.plist when performing an export operation.

      The help for xcodebuild in Xcode 9 states:

      provisioningProfiles : Dictionary 

      For manual signing only. Specify the provisioning profile to use for each executable in your app. Keys in this dictionary are the bundle identifiers of executables; values are the provisioning profile name or UUID to use.

      It would probably require an extra field in the xcodebuild plugin config to allow a profile to be specified by name orUUID, and if specified, include it in the generated exportOptions plist. Or, possibly allow the option of specifying your own exportOptionsPlist that is used instead of the generated one, if specified.

      Without this option, projects that use manual code signing cannot build with jenkins and this plugin.

       

      the console output for a failing build:

      $ /usr/bin/xcodebuild -exportArchive -archivePath "/pathto/app.xcarchive" -exportPath "/pathto/export" -exportOptionsPlist "/pathto/ad-hocTEAMIDExport.plist"
      2017-07-13 12:02:52.196 xcodebuild[5043:2359795] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/sh/pathto/logs'.
      2017-07-13 12:02:53.262 xcodebuild[5043:2359795] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7fc0fdfd8720>: Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed." UserInfo={NSLocalizedDescription=Locating signing assets failed., IDEDistributionSigningAssetStepUnderlyingErrors=(
      {{ "Error Domain=IDEProvisioningErrorDomain Code=9 \"\"MyApp.app\" requires a provisioning profile.\" UserInfo={NSLocalizedDescription=\"MyApp.app\" requires a provisioning profile., NSLocalizedRecoverySuggestion=Select a provisioning profile for the \"Default\" build configuration in the project editor.}"}}
      )}
      error: exportArchive: "MyApp.app" requires a provisioning profile.Error Domain=IDEProvisioningErrorDomain Code=9 ""MyApp.app" requires a provisioning profile." UserInfo={NSLocalizedDescription="MyApp.app" requires a provisioning profile., NSLocalizedRecoverySuggestion=Select a provisioning profile for the "Default" build configuration in the project editor.}** EXPORT FAILED **

        Attachments

          Issue Links

            Activity

            jamesrantmedia James Addyman created issue -
            jamesrantmedia James Addyman made changes -
            Field Original Value New Value
            Description Since Xcode 9, builds that use manual code signing require that a provisioning profile is specified in the exportOptions.plist when performing an export operation.

            The help for xcodebuild in Xcode 9 states:
            {quote}provisioningProfiles : Dictionary 

             For manual signing only. Specify the provisioning profile to use for each executable in your app. Keys in this dictionary are the bundle identifiers of executables; values are the provisioning profile name or UUID to use.
            {quote}
            It would probably require an extra field in the xcodebuild plugin config to allow a profile to be specified by name orUUID, and if specified, include it in the generated exportOptions plist.

            Without this option, projects that use manual code signing cannot build with jenkins and this plugin.

             

            the console output for a failing build:

            {{$ /usr/bin/xcodebuild -exportArchive -archivePath "/pathto/app.xcarchive" -exportPath "/pathto/export" -exportOptionsPlist "/pathto/ad-hocTEAMIDExport.plist"}}
            {{2017-07-13 12:02:52.196 xcodebuild[5043:2359795] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/sh/pathto/logs'.}}
            {{2017-07-13 12:02:53.262 xcodebuild[5043:2359795] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7fc0fdfd8720>: Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed." UserInfo=\{NSLocalizedDescription=Locating signing assets failed., IDEDistributionSigningAssetStepUnderlyingErrors=(}}
            {{ "Error Domain=IDEProvisioningErrorDomain Code=9 \"\"MyApp.app\" requires a provisioning profile.\" UserInfo=\{NSLocalizedDescription=\"MyApp.app\" requires a provisioning profile., NSLocalizedRecoverySuggestion=Select a provisioning profile for the \"Default\" build configuration in the project editor.}"}}
            {{)}}}
            {{error: exportArchive: "MyApp.app" requires a provisioning profile.}}{{Error Domain=IDEProvisioningErrorDomain Code=9 ""MyApp.app" requires a provisioning profile." UserInfo=\{NSLocalizedDescription="MyApp.app" requires a provisioning profile., NSLocalizedRecoverySuggestion=Select a provisioning profile for the "Default" build configuration in the project editor.}}}{{** EXPORT FAILED **}}
            Since Xcode 9, builds that use manual code signing require that a provisioning profile is specified in the exportOptions.plist when performing an export operation.

            The help for xcodebuild in Xcode 9 states:
            {quote}provisioningProfiles : Dictionary 

            For manual signing only. Specify the provisioning profile to use for each executable in your app. Keys in this dictionary are the bundle identifiers of executables; values are the provisioning profile name or UUID to use.
            {quote}
            It would probably require an extra field in the xcodebuild plugin config to allow a profile to be specified by name orUUID, and if specified, include it in the generated exportOptions plist. Or, possibly allow the option of specifying your own exportOptionsPlist that is used instead of the generated one, if specified.

            Without this option, projects that use manual code signing cannot build with jenkins and this plugin.

             

            the console output for a failing build:

            {{$ /usr/bin/xcodebuild -exportArchive -archivePath "/pathto/app.xcarchive" -exportPath "/pathto/export" -exportOptionsPlist "/pathto/ad-hocTEAMIDExport.plist"}}
             {{2017-07-13 12:02:52.196 xcodebuild[5043:2359795] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/sh/pathto/logs'.}}
             {{2017-07-13 12:02:53.262 xcodebuild[5043:2359795] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7fc0fdfd8720>: Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed." UserInfo=\{NSLocalizedDescription=Locating signing assets failed., IDEDistributionSigningAssetStepUnderlyingErrors=(}}
             \{\{ "Error Domain=IDEProvisioningErrorDomain Code=9 \"\"MyApp.app\" requires a provisioning profile.\" UserInfo=\{NSLocalizedDescription=\"MyApp.app\" requires a provisioning profile., NSLocalizedRecoverySuggestion=Select a provisioning profile for the \"Default\" build configuration in the project editor.}"}}
             {{)}}}
             {{error: exportArchive: "MyApp.app" requires a provisioning profile.}}{{Error Domain=IDEProvisioningErrorDomain Code=9 ""MyApp.app" requires a provisioning profile." UserInfo=\{NSLocalizedDescription="MyApp.app" requires a provisioning profile., NSLocalizedRecoverySuggestion=Select a provisioning profile for the "Default" build configuration in the project editor.}}}{{** EXPORT FAILED **}}
            Hide
            rajeevs Rajeev Sharma added a comment -

            I am facing the same issue. 

            Show
            rajeevs Rajeev Sharma added a comment - I am facing the same issue. 
            Hide
            jflotte Julien Flotté added a comment -

            I am facing the same issue too.

            Show
            jflotte Julien Flotté added a comment - I am facing the same issue too.
            Hide
            tlafferty Tyler Lafferty added a comment -

            I have this same issue as well.

            Show
            tlafferty Tyler Lafferty added a comment - I have this same issue as well.
            Hide
            sgruby Scott Gruby added a comment -

            This particular part of the plugin seems to be problematic with each Xcocde upgrade. I finally made a script that is invoked after the Xcode build step using something like:

             

            ${WORKSPACE}/Common/Scripts/archive.swift ${EXPORT_METHOD} ${TEAM_ID} "${WORKSPACE}/Build" "${WORKSPACE}" "${PROVISIONING_PROFILE_NAME}" 
            mv "${WORKSPACE}"/*.ipa "${WORKSPACE}/${APP_NAME}-${BRANCH}-${CONFIGURATION}-${MAJOR_MINOR_VERSION}-${SHORT_VERSION}-${FULL_BUILD_DATE}.ipa"

            Where I have parameters for EXPORT_METHOD, TEAM_ID, and PROVISIONING_PROFILE_NAME. (The other parameters are ones specific to my jobs that I use to build up the resulting ipa file name.) You also have to make sure you check the Create archive option in the Xcode build options.

            I hope this helps others.

            Show
            sgruby Scott Gruby added a comment - This particular part of the plugin seems to be problematic with each Xcocde upgrade. I finally made a script  that is invoked after the Xcode build step using something like:   ${WORKSPACE}/Common/Scripts/archive.swift ${EXPORT_METHOD} ${TEAM_ID} "${WORKSPACE}/Build" "${WORKSPACE}" "${PROVISIONING_PROFILE_NAME}" mv "${WORKSPACE}" /*.ipa "${WORKSPACE}/${APP_NAME}-${BRANCH}-${CONFIGURATION}-${MAJOR_MINOR_VERSION}-${SHORT_VERSION}-${FULL_BUILD_DATE}.ipa" Where I have parameters for EXPORT_METHOD, TEAM_ID, and PROVISIONING_PROFILE_NAME. (The other parameters are ones specific to my jobs that I use to build up the resulting ipa file name.) You also have to make sure you check the Create archive option in the Xcode build options. I hope this helps others.
            Hide
            igomobile Ilya Gorodnyanskiy added a comment -

            I'll give a try to the workaround suggested by Scott, however a real solution for the problem would be highly appreciated.

            Show
            igomobile Ilya Gorodnyanskiy added a comment - I'll give a try to the workaround suggested by Scott, however a real solution for the problem would be highly appreciated.
            Hide
            jondkimball Jon Kimball added a comment -

            I have this issue after upgrading to xcode 9.0

            Show
            jondkimball Jon Kimball added a comment - I have this issue after upgrading to xcode 9.0
            Hide
            stakenborg Brandon Stakenborg added a comment -

            Same issue here. Can't get Jenkins to properly make a build with or without manual signing at this point.

            Show
            stakenborg Brandon Stakenborg added a comment - Same issue here. Can't get Jenkins to properly make a build with or without manual signing at this point.
            Hide
            elihaib Elihai Blomberg added a comment -

            hi,

            did someone find a solution for this?

            Show
            elihaib Elihai Blomberg added a comment - hi, did someone find a solution for this?
            elihaib Elihai Blomberg made changes -
            Priority Blocker [ 1 ] Critical [ 2 ]
            Hide
            nguyenhoang nguyen hoang added a comment - - edited

            Create a plist file for export options like this:

             

            # Create .plist file for exporting
            echo "
            <?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>method</key>
             <string>enterprise</string>
             
             <key>provisioningProfiles</key>
             <dict>
             <key>"$BUNDLE_ID"</key>
             <string>"$TARGET_PROVISIONING_PROFILE_SPECIFIER"</string>
             </dict>
             
             <key>signingCertificate</key>
             <string>"$SIGNING_CERTIFICATE"</string>
             
             <key>teamID</key>
             <string>"$TEAM_ID"</string>
             
             <key>signingStyle</string>
             <string>manual</string>
            </dict>
            </plist>
            " > ${WORKSPACE}/export_options.plist 
            

             

            Use this export_options.plist file for export_options in fastlane gym command build

            # Using for Xcode 9
            fastlane gym --workspace Example.xcworkspace \
            --scheme ${SCHEME} \
            --sdk 'iphoneos' \
            --configuration Staging \
            --output_directory ${BUILD_FOLDER} \
            --output_name app_name.ipa \
            --codesigning_identity "$SIGNING_CERTIFICATE" \
            --xcargs "PROVISIONING_PROFILE_SPECIFIER='${TARGET_PROVISIONING_PROFILE_SPECIFIER}' \
            --export_options "${WORKSPACE}/export_options.plist" \
            --verbose \
            --buildlog_path ${WORKSPACE}
            

            Give it a go.

            Show
            nguyenhoang nguyen hoang added a comment - - edited Create a plist file for export options like this:   # Create .plist file for exporting echo " <?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>method</key> <string>enterprise</string> <key>provisioningProfiles</key> <dict> <key> "$BUNDLE_ID" </key> <string> "$TARGET_PROVISIONING_PROFILE_SPECIFIER" </string> </dict> <key>signingCertificate</key> <string> "$SIGNING_CERTIFICATE" </string> <key>teamID</key> <string> "$TEAM_ID" </string> <key>signingStyle</string> <string>manual</string> </dict> </plist> " > ${WORKSPACE}/export_options.plist    Use this export_options.plist file for export_options in fastlane gym command build # Using for Xcode 9 fastlane gym --workspace Example.xcworkspace \ --scheme ${SCHEME} \ --sdk 'iphoneos' \ --configuration Staging \ --output_directory ${BUILD_FOLDER} \ --output_name app_name.ipa \ --codesigning_identity "$SIGNING_CERTIFICATE" \ --xcargs "PROVISIONING_PROFILE_SPECIFIER= '${TARGET_PROVISIONING_PROFILE_SPECIFIER}' \ --export_options "${WORKSPACE}/export_options.plist" \ --verbose \ --buildlog_path ${WORKSPACE} Give it a go.
            stakenborg Brandon Stakenborg made changes -
            Priority Critical [ 2 ] Blocker [ 1 ]
            Hide
            davewhittaker David Whittaker added a comment -

            Thanks to the nguyen hoang I was able to work around the problem.  Here is what I did:

            1. Turn off "Pack application, build and sign .ipa?" and turn on "Generate Archive?" under general build settings
            2. Add an Execute Shell build step after your Xcode step to generate the export_options.plist as above.  The environment variables there aren't provided by Jenkins, so you'll have to fill in your own values.  Also, I think "signingCertificate" needs to actually be "installerSigningCertificate" and I had to add a "compileBitcode" key with value of <false/>
            3. Add another Execute Shell build step to generate the ipa.  It will look something like this
            xcodebuild -exportArchive \
             -archivePath [path to the archive you generated in step 1, it will be in ${BUILD_DIR}] \
             -exportPath [the folder where you want your IPA stored] \
             -exportOptionsPlist [the file you created in step 2]

             

            That allowed me to get an IPA built with manual signing.  Good luck!

            Show
            davewhittaker David Whittaker added a comment - Thanks to the nguyen hoang  I was able to work around the problem.  Here is what I did: Turn off "Pack application, build and sign .ipa?" and turn on "Generate Archive?" under general build settings Add an Execute Shell build step after your Xcode step to generate the export_options.plist as above.  The environment variables there aren't provided by Jenkins, so you'll have to fill in your own values.  Also, I think "signingCertificate" needs to actually be "installerSigningCertificate" and I had to add a "compileBitcode" key with value of <false/> Add another Execute Shell build step to generate the ipa.  It will look something like this xcodebuild -exportArchive \ -archivePath [path to the archive you generated in step 1, it will be in ${BUILD_DIR}] \ -exportPath [the folder where you want your IPA stored] \ -exportOptionsPlist [the file you created in step 2]   That allowed me to get an IPA built with manual signing.  Good luck!
            Hide
            fbeeper Ferran Poveda added a comment - - edited

            On the same boat here!

            Since I have a bunch of targets and configurations to be building and archiving, I created a script to extract the signing settings from the build configuration (plus some parameters can be tunned/added too) to automatically create an exportOptions.plist.

            With that, I "simply" ran xcodebuild -exportArchive to get my ipa.

            But let me share a big bump in my experience, just in case it may help somebody out there:

            When executing xcodebuild -exportArchive through an ssh session, it failed with a segmentation fault. The logs clarified nothing by failing with an "unknown error -1=ffffffffffffffff". Same executed locally just works. As far as I could understand codesign fails because xcodebuild can't reach the keys on the keychain while running on ssh. Will try to really know why, but meanwhile, just run your experiments on the machine itself .

            Show
            fbeeper Ferran Poveda added a comment - - edited On the same boat here! Since I have a bunch of targets and configurations to be building and archiving, I created a script to extract the signing settings from the build configuration (plus some parameters can be tunned/added too) to automatically create an exportOptions.plist. With that, I "simply" ran xcodebuild -exportArchive to get my ipa. But let me share a big bump in my experience, just in case it may help somebody out there: When executing xcodebuild -exportArchive through an ssh session, it failed with a segmentation fault. The logs clarified nothing by failing with an "unknown error -1=ffffffffffffffff". Same executed locally just works. As far as I could understand codesign fails because xcodebuild can't reach the keys on the keychain while running on ssh. Will try to really know why, but meanwhile, just run your experiments on the machine itself .
            Hide
            fbeeper Ferran Poveda added a comment - - edited

            BTW, I've seen there is a PR on Github for an update to the plugin that would solve us having to workaround the signing like this.

            But, as far as I understand, it is just able to ask for an explicit configuration rather than taking one from the build settings. Even though I have 0 experience on the internals of this Xcode plugin I may be able to help to get this included somehow. Let me know if you'd be interested in such feature, and scream loudly if you know about the Xcode plugin guts, and want to collaborate on doing it.

            Show
            fbeeper Ferran Poveda added a comment - - edited BTW, I've seen there is a PR on Github for an update to the plugin that would solve us having to workaround the signing like this. But, as far as I understand, it is just able to ask for an explicit configuration rather than taking one from the build settings. Even though I have 0 experience on the internals of this Xcode plugin I may be able to help to get this included somehow. Let me know if you'd be interested in such feature, and scream loudly if you know about the Xcode plugin guts, and want to collaborate on doing it.
            juanmoya Juan Moya made changes -
            Link This issue relates to JENKINS-47744 [ JENKINS-47744 ]
            Hide
            alkesh_f Alkesh Fudani added a comment -

            Hi All,

            What was the final solution to set up the jenkins for xcode 9? Can you please help me with the export plist creation and setting up export_options?

            Also, will it require fastlane also to be installed on ci server?

            please help, thanks in advance.

             

            Show
            alkesh_f Alkesh Fudani added a comment - Hi All, What was the final solution to set up the jenkins for xcode 9? Can you please help me with the export plist creation and setting up export_options? Also, will it require fastlane also to be installed on ci server? please help, thanks in advance.  
            alkesh_f Alkesh Fudani made changes -
            Assignee nguyen hoang [ nguyenhoang ]
            Hide
            nguyenhoang nguyen hoang added a comment -

            Alkesh Fudani, please see the my comment above. That helps creating export plist file used in exporting ipa file in Xcode 9.

            Installing fastlane on CI server is definitely required if you wanna use fastlane to build an iOS application.

            Show
            nguyenhoang nguyen hoang added a comment - Alkesh Fudani , please see the my comment above. That helps creating export plist file used in exporting ipa file in Xcode 9. Installing fastlane on CI server is definitely required if you wanna use fastlane to build an iOS application.
            alkesh_f Alkesh Fudani made changes -
            alkesh_f Alkesh Fudani made changes -
            Hide
            alkesh_f Alkesh Fudani added a comment - - edited

            nguyen hoang, I am using Jenkins and I followed all the instructions given in your comment, but the jenkins still fails to generate the build, I have attached screenshots of my export_options file and the error given in jenkins console. Any help appreciated.

            Also, further to this, I have jenkins setup for multiple provisioning profiles using multiple bundle ids in xcode 8.3, so for xcode 9 should I make multiple export options files? or I can specify array of bundle id, provisioning profile, team id in the same file?

            Show
            alkesh_f Alkesh Fudani added a comment - - edited nguyen hoang , I am using Jenkins and I followed all the instructions given in your comment, but the jenkins still fails to generate the build, I have attached screenshots of my export_options file and the error given in jenkins console. Any help appreciated. Also, further to this, I have jenkins setup for multiple provisioning profiles using multiple bundle ids in xcode 8.3, so for xcode 9 should I make multiple export options files? or I can specify array of bundle id, provisioning profile, team id in the same file?
            Hide
            nguyenhoang nguyen hoang added a comment -

            Alkesh Fudani If you're using multiple provisioning profiles for multiple bundle id(s), make sure you include those in exporting plist file like following:

             # Create .plist file for exporting
            echo "
            <?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>method</key>
             <string>enterprise</string>
             
             <key>provisioningProfiles</key>
             <dict>
             <key>$BUNDLE_ID_1</key>
             <string>"$TARGET_PROVISIONING_PROFILE_SPECIFIER_1"</string>
             <key>$BUNDLE_ID_2</key>
             <string>"$TARGET_PROVISIONING_PROFILE_SPECIFIER_2"</string>
             <key>$BUNDLE_ID_3</key>
             <string>"$TARGET_PROVISIONING_PROFILE_SPECIFIER_3"</string>
             </dict>
             
             <key>signingCertificate</key>
             <string>"$CODESIGNING_IDENTITY"</string>
             
             <key>teamID</key>
             <string>$TEAM_ID</string>
             
             <key>signingStyle</string>
             <string>manual</string>
            </dict>
            </plist>
            " > ${WORKSPACE}/export_options.plist

             

            TARGET_PROVISIONING_PROFILE_SPECIFIER_1='<TEAM_ID>/<PROFILE_NAME>'

            Example:

            TARGET_PROVISIONING_PROFILE_SPECIFIER_1='M7T5ABXCF/comProvisioningProfileExample'

             

             

            Show
            nguyenhoang nguyen hoang added a comment - Alkesh Fudani If you're using multiple provisioning profiles for multiple bundle id(s), make sure you include those in exporting plist file like following:  # Create .plist file for exporting echo " <?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>method</key> <string>enterprise</string> <key>provisioningProfiles</key> <dict> <key>$BUNDLE_ID_1</key> <string> "$TARGET_PROVISIONING_PROFILE_SPECIFIER_1" </string> <key>$BUNDLE_ID_2</key> <string> "$TARGET_PROVISIONING_PROFILE_SPECIFIER_2" </string> <key>$BUNDLE_ID_3</key> <string> "$TARGET_PROVISIONING_PROFILE_SPECIFIER_3" </string> </dict> <key>signingCertificate</key> <string> "$CODESIGNING_IDENTITY" </string> <key>teamID</key> <string>$TEAM_ID</string> <key>signingStyle</string> <string>manual</string> </dict> </plist> " > ${WORKSPACE}/export_options.plist   TARGET_PROVISIONING_PROFILE_SPECIFIER_1= '<TEAM_ID>/<PROFILE_NAME>' Example: TARGET_PROVISIONING_PROFILE_SPECIFIER_1= 'M7T5ABXCF/comProvisioningProfileExample'    
            Hide
            alkesh_f Alkesh Fudani added a comment -

            nguyen hoang what about the code signing identity and the team id?

            Show
            alkesh_f Alkesh Fudani added a comment - nguyen hoang what about the code signing identity and the team id?
            Hide
            nguyenhoang nguyen hoang added a comment - - edited

            Alkesh Fudani

            In your case:

            TEAM_ID=M7T5YNZ969
            CODESIGNING_IDENTITY='iPhone Distribution: XXXXXXX'

            CODESIGNING_IDENTITY is name of certificate that you're going to use to sign the app. Using command

            security find-identity -v -p codesigning

            to find appropriate signing identity.

             

            Show
            nguyenhoang nguyen hoang added a comment - - edited Alkesh Fudani In your case: TEAM_ID=M7T5YNZ969 CODESIGNING_IDENTITY= 'iPhone Distribution: XXXXXXX' CODESIGNING_IDENTITY is name of certificate that you're going to use to sign the app. Using command security find-identity -v -p codesigning to find appropriate signing identity.  
            alkesh_f Alkesh Fudani made changes -
            Comment [ [~nguyenhoang] my question meant, how do I put multiple code signing identity and team id?, Sorry for bothering you so many times but I need to sort this out. ]
            Hide
            alkesh_f Alkesh Fudani added a comment -

            Thanks for you help, I am successful at configuring the CI set up now.. 

            Show
            alkesh_f Alkesh Fudani added a comment - Thanks for you help, I am successful at configuring the CI set up now.. 
            Hide
            nguyenhoang nguyen hoang added a comment -

            Great!

            Show
            nguyenhoang nguyen hoang added a comment - Great!
            oleg_nenashev Oleg Nenashev made changes -
            Link This issue is duplicated by JENKINS-48256 [ JENKINS-48256 ]
            Hide
            ronakpatel786 Ronak Patel added a comment -

            nguyen hoang I have followed the steps that you have mentioned in this ticket. Also, I have followed Alkesh Fudani's comments as he is also using Jenkins to build his ios apps. 

            I am using xcode plugin (version 2.0.1) with jenkins to generate builds for our multi-targeted app.

            With Xcode 9, our jenkins build configuration is able to generate the archive but fails to create the ipa. The error message is as follows:

            Error Domain=IDEProvisioningErrorDomain Code=9 ""test.app" requires a provisioning profile." UserInfo={NSLocalizedDescription="test.app" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}

            I have already added the provisioning profile inside Jenkins Custom xcodebuild arguments*section by passing the PROVISIONING_PROFILE, PROVISIONING_PROFILE_SPECIFIER, CODE_SIGN_IDENTITY, CODE_SIGN_STYLE and DEVELOPMENT_TEAM however, it still shoots the same error message. Besides, I also pass the ExportOptions.plist file in the Build phases Run script option but it seems that Xcode generates its own ExportOptions.plist(*enterpriseTEAMIDExport.plist) and ignores mine. When I open enterpriseTEAMIDExport.plist file it only contains the teamid and the method of export and so, it doesn't find the provisioning profile.

            So, how can I tell xcode to use my ExportOptions.plist file instead? I have followed the image here but unable to find it inside Xcode 9. Also, this post doesn't relate to me.

            Another important thing is that I am able to generate the ipa using my own ExportOptions.plist file from command line xcodebuild tool using this command as follows:

            xcodebuild -exportArchive -archivePath archive.xcarchive -exportPath /my/export/path -exportOptionsPlist options.plist

            So, I don't know why it doesn't work with Jenkins Xcode plugin.

            Any help is much appreciated.

            Thanks!

             

            Show
            ronakpatel786 Ronak Patel added a comment - nguyen hoang I have followed the steps that you have mentioned in this ticket. Also, I have followed Alkesh Fudani 's comments as he is also using Jenkins to build his ios apps.  I am using xcode plugin (version 2.0.1) with jenkins to generate builds for our multi-targeted app. With Xcode 9, our jenkins build configuration is able to generate the archive but fails to create the ipa. The error message is as follows: Error Domain=IDEProvisioningErrorDomain Code=9 ""test.app" requires a provisioning profile." UserInfo={NSLocalizedDescription="test.app" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list. } I have already added the provisioning profile inside Jenkins  Custom xcodebuild arguments*section by passing the PROVISIONING_PROFILE, PROVISIONING_PROFILE_SPECIFIER, CODE_SIGN_IDENTITY, CODE_SIGN_STYLE and DEVELOPMENT_TEAM however, it still shoots the same error message. Besides, I also pass the ExportOptions.plist file in the Build phases Run script option but it seems that Xcode generates its own ExportOptions.plist(*enterpriseTEAMIDExport.plist ) and ignores mine. When I open enterpriseTEAMIDExport.plist file it only contains the teamid and the method of export and so, it doesn't find the provisioning profile. So, how can I tell xcode to use my ExportOptions.plist file instead? I have followed the image  here  but unable to find it inside Xcode 9. Also,  this  post doesn't relate to me. Another important thing is that I am able to generate the ipa using my own ExportOptions.plist file from command line xcodebuild tool using this command as follows: xcodebuild -exportArchive -archivePath archive.xcarchive -exportPath /my/export/path -exportOptionsPlist options.plist So, I don't know why it doesn't work with Jenkins Xcode plugin. Any help is much appreciated. Thanks!  
            Hide
            nguyenhoang nguyen hoang added a comment -

            Hey Ronak Patel!

            It looks like it's problem of the plugin not of Xcode or they do have a option for using custom plist file that you don't know yet. I don't use Jenkins Xcode plugin for iOS build so can not give it a try with my Jenkins.

            Which version of Xcode integration plugin are you using? Is it the latest one? I do think it has a option for using custom plist file when exporting ipa executable.

            Show
            nguyenhoang nguyen hoang added a comment - Hey  Ronak Patel ! It looks like it's problem of the plugin not of Xcode or they do have a option for using custom plist file that you don't know yet. I don't use Jenkins Xcode plugin for iOS build so can not give it a try with my Jenkins. Which version of Xcode integration plugin are you using? Is it the latest one? I do think it has a option for using custom plist file when exporting ipa executable.
            Hide
            ronakpatel786 Ronak Patel added a comment -

            Hello nguyen,

            Thanks for your prompt response. I am using the latest version of xcode plugin (2.0.1).

            I have read their documentation but can't find a way to use my custom plist file. If you can't find anything, that would be a great help.

            Also, if there is way to pass my custom plist file as a custom argument, it would be a great thing to know.

            Thanks again.

            Show
            ronakpatel786 Ronak Patel added a comment - Hello nguyen, Thanks for your prompt response. I am using the latest version of xcode plugin (2.0.1). I have read their documentation but can't find a way to use my custom plist file. If you can't find anything, that would be a great help. Also, if there is way to pass my custom plist file as a custom argument, it would be a great thing to know. Thanks again.
            Hide
            nguyenhoang nguyen hoang added a comment -

            Hey Ronak Patel!

            1. Suggest a workaround in your case: Set to skip export .ipa and manually export ipa with custom plist file with xcodebuild command line: xcodebuild -exportArchive -archivePath archive.xcarchive -exportPath /my/export/path -exportOptionsPlist options.plist
            2. Do you wanna use Faslane for your iOS builds? It's easy to setup a build.
            Show
            nguyenhoang nguyen hoang added a comment - Hey Ronak Patel ! Suggest a workaround in your case: Set to skip export .ipa and manually export ipa with custom plist file with xcodebuild command line: xcodebuild -exportArchive -archivePath archive.xcarchive -exportPath /my/export/path -exportOptionsPlist options.plist Do you wanna use Faslane for your iOS builds? It's easy to setup a build.
            Hide
            ronakpatel786 Ronak Patel added a comment -

            Hi Nguyen,

            Thanks, once again.

            1. At present, I am using the same approach to generate builds using xcodebuild command line. However, I have a project with 15 targets. So, don't you think it is time consuming to generate build for each target one by one? This leads to my other question which is:
            2. 2. Would it be much easier to setup up multi-targeted builds using Fastlane? It's because I already have a Jenkins setup running so..

            Looking forward for your help.
            Thanks

            Show
            ronakpatel786 Ronak Patel added a comment - Hi Nguyen, Thanks, once again. At present, I am using the same approach to generate builds using xcodebuild command line. However, I have a project with 15 targets. So, don't you think it is time consuming to generate build for each target one by one? This leads to my other question which is: 2. Would it be much easier to setup up multi-targeted builds using Fastlane? It's because I already have a Jenkins setup running so.. Looking forward for your help. Thanks
            Hide
            nguyenhoang nguyen hoang added a comment -

            Seems that in your case, you wanna have 15 ipa executable for 15 targets  I've never tried it before but found that Fastlane does support that. Give it a go.

            https://github.com/fastlane/fastlane/issues/88

            https://docs.fastlane.tools/faqs/ (Multiple targets of the same underlying app)

            Show
            nguyenhoang nguyen hoang added a comment - Seems that in your case, you wanna have 15 ipa executable for 15 targets  I've never tried it before but found that Fastlane does support that. Give it a go. https://github.com/fastlane/fastlane/issues/88 https://docs.fastlane.tools/faqs/  (Multiple targets of the same underlying app)
            Hide
            ronakpatel786 Ronak Patel added a comment -

            Yes, very true  . I will take a look at these docs and see how it goes.

            Thanks a lot, nguyen hoang.

            Show
            ronakpatel786 Ronak Patel added a comment - Yes, very true  . I will take a look at these docs and see how it goes. Thanks a lot, nguyen hoang .
            Hide
            nguyenhoang nguyen hoang added a comment -

            You're welcome, hope that helps.

            Show
            nguyenhoang nguyen hoang added a comment - You're welcome, hope that helps.
            Hide
            gauravborole Gaurav Borole added a comment - - edited

            _How to Add a profile to the "provisioningProfiles" dictionary in your Export Options property list through jenkins.?? _

            Command shell:
            xcodebuild -exportArchive -archivePath ${WORKSPACE}/build/YourProject.xcarchive -exportPath ${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_NUMBER}/archive -exportOptionsPlist
            ${WORKSPACE}/ExportOptions.plist

            Getting error:

            2018-02-01 17:11:04.046 xcodebuild[57285:71980734] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7fe61c53aff0>: Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed." UserInfo={NSLocalizedDescription=Locating signing assets failed., IDEDistributionSigningAssetStepUnderlyingErrors=(
            "Error Domain=IDEProvisioningErrorDomain Code=9 \"\"MobileXXXXX.app\" requires a provisioning profile.\" UserInfo=

            {NSLocalizedDescription=\"MobileXXXXX.app\" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the \"provisioningProfiles\" dictionary in your Export Options property list.}"
            )}
            error: exportArchive: "MobileXXXXX.app" requires a provisioning profile.

            Error Domain=IDEProvisioningErrorDomain Code=9 ""MobileXXXXX.app" requires a provisioning profile." UserInfo={NSLocalizedDescription="MobileXXXXX.app" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}
              • EXPORT FAILED **
            Show
            gauravborole Gaurav Borole added a comment - - edited _How to Add a profile to the "provisioningProfiles" dictionary in your Export Options property list through jenkins.?? _ Command shell: xcodebuild -exportArchive -archivePath ${WORKSPACE}/build/YourProject.xcarchive -exportPath ${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_NUMBER}/archive -exportOptionsPlist ${WORKSPACE}/ExportOptions.plist Getting error: 2018-02-01 17:11:04.046 xcodebuild [57285:71980734] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7fe61c53aff0>: Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed." UserInfo={NSLocalizedDescription=Locating signing assets failed., IDEDistributionSigningAssetStepUnderlyingErrors=( "Error Domain=IDEProvisioningErrorDomain Code=9 \"\"MobileXXXXX.app\" requires a provisioning profile.\" UserInfo= {NSLocalizedDescription=\"MobileXXXXX.app\" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the \"provisioningProfiles\" dictionary in your Export Options property list.}" )} error: exportArchive: "MobileXXXXX.app" requires a provisioning profile. Error Domain=IDEProvisioningErrorDomain Code=9 ""MobileXXXXX.app" requires a provisioning profile." UserInfo={NSLocalizedDescription="MobileXXXXX.app" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.} EXPORT FAILED **
            Hide
            jay_triv Jay Trivedi added a comment -

            Gaurav Borole You need to mention provisioning profile in ExportOptions.plist file.

            Show
            jay_triv Jay Trivedi added a comment - Gaurav Borole You need to mention provisioning profile in ExportOptions.plist file.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Kazuhide Takahashi
            Path:
            src/main/java/au/com/rayh/ProvisioningProfile.java
            src/main/java/au/com/rayh/XCodeBuilder.java
            src/main/resources/au/com/rayh/Messages.properties
            src/main/resources/au/com/rayh/XCodeBuilder/config.jelly
            http://jenkins-ci.org/commit/xcode-plugin/5d4f52127cccbe60a52121083f70f9dc29e7e73b
            Log:
            Merge pull request #86 from lampietti/xcode9

            add xcode9 new signing support JENKINS-45509

            Compare: https://github.com/jenkinsci/xcode-plugin/compare/7172a7c67279...5d4f52127ccc

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kazuhide Takahashi Path: src/main/java/au/com/rayh/ProvisioningProfile.java src/main/java/au/com/rayh/XCodeBuilder.java src/main/resources/au/com/rayh/Messages.properties src/main/resources/au/com/rayh/XCodeBuilder/config.jelly http://jenkins-ci.org/commit/xcode-plugin/5d4f52127cccbe60a52121083f70f9dc29e7e73b Log: Merge pull request #86 from lampietti/xcode9 add xcode9 new signing support JENKINS-45509 Compare: https://github.com/jenkinsci/xcode-plugin/compare/7172a7c67279...5d4f52127ccc
            Hide
            ronakpatel786 Ronak Patel added a comment -

            SCM/JIRA link daemon so, now we should be able to use jenkins to create our build successfully, right? 

            Show
            ronakpatel786 Ronak Patel added a comment - SCM/JIRA link daemon so, now we should be able to use jenkins to create our build successfully, right? 
            Hide
            ronakpatel786 Ronak Patel added a comment -

            SCM/JIRA link daemon what version of jenkins will have this change? nguyen hoang James Addyman

            Show
            ronakpatel786 Ronak Patel added a comment - SCM/JIRA link daemon  what version of jenkins will have this change? nguyen hoang James Addyman
            Hide
            nguyenhoang nguyen hoang added a comment -

            Ronak Patel I haven't used Jenkins plugins for iOS builds so have no idea about this.

            Show
            nguyenhoang nguyen hoang added a comment - Ronak Patel I haven't used Jenkins plugins for iOS builds so have no idea about this.
            Hide
            jay_triv Jay Trivedi added a comment -

             

            Ronak Patel , Currently Kazuhide Takahashi just merged updated code on github repository of [xcode-jenkins plugin|https://github.com/jenkinsci/xcode-plugin.]

            Still, the release of that code is pending. Once they release this update for this plugin will be available.

            Show
            jay_triv Jay Trivedi added a comment -   Ronak Patel , Currently Kazuhide Takahashi just merged updated code on github repository of [xcode-jenkins plugin| https://github.com/jenkinsci/xcode-plugin .] Still, the release of that code is pending. Once they release this update for this plugin will be available.
            Hide
            kapten_perk David Eklund added a comment - - edited

            I just updated to Jenkins 2.122 and xcode-plugin 2.0.2. We run several test slaves with MacOS, one of the having the version 10.11.6 (El Captain). After the update, the builds on this machine failes (the machines running newer MacOS versions work just fine) with the following message:

            $ /usr/bin/xcodebuild -scheme "App" -workspace /Users/user/Jenkins/BuildWorkspace/App.xcworkspace -configuration Release clean build -allowProvisioningUpdates
            xcodebuild: error: invalid option '-allowProvisioningUpdates'

            This fix seems like a probable culprit. Is it in 2.0.2? If so, is there a work around?

            Show
            kapten_perk David Eklund added a comment - - edited I just updated to Jenkins 2.122 and xcode-plugin 2.0.2. We run several test slaves with MacOS, one of the having the version 10.11.6 (El Captain). After the update, the builds on this machine failes (the machines running newer MacOS versions work just fine) with the following message: $ /usr/bin/xcodebuild -scheme "App" -workspace /Users/user/Jenkins/BuildWorkspace/App.xcworkspace -configuration Release clean build -allowProvisioningUpdates xcodebuild: error: invalid option '-allowProvisioningUpdates' This fix seems like a probable culprit. Is it in 2.0.2? If so, is there a work around?
            Hide
            stephanwezelps Stephan Wezel added a comment - - edited

            -allowProvisioningUpdates seems to be an option added with xcode 9

            https://www.developerinsider.in/whats-new-in-xcode-9

            David Eklund: Which xcode version do you use?

            Show
            stephanwezelps Stephan Wezel added a comment - - edited -allowProvisioningUpdates seems to be an option added with xcode 9 https://www.developerinsider.in/whats-new-in-xcode-9 David Eklund : Which xcode version do you use?
            Hide
            kapten_perk David Eklund added a comment - - edited

            Stephan Wezel: The machine runs Xcode 7.3.1. That seems to be the last version of Xcode from the App store in El Captain.

            Show
            kapten_perk David Eklund added a comment - - edited Stephan Wezel : The machine runs Xcode 7.3.1. That seems to be the last version of Xcode from the App store in El Captain.

              People

              • Assignee:
                nguyenhoang nguyen hoang
                Reporter:
                jamesrantmedia James Addyman
              • Votes:
                23 Vote for this issue
                Watchers:
                31 Start watching this issue

                Dates

                • Created:
                  Updated: