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

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

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • xcode-plugin
    • Xcode 9 (beta 2), xcodebuild plugin 2.0

      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 **

          [JENKINS-45509] Xcode 9 requires provisioning profile to be specified when using manual code signing

          James Addyman created issue -
          James Addyman made changes -
          Description Original: 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 **}}
          New: 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 **}}

          Rajeev Sharma added a comment -

          I am facing the same issue. 

          Rajeev Sharma added a comment - I am facing the same issue. 

          I am facing the same issue too.

          Julien Flotté added a comment - I am facing the same issue too.

          I have this same issue as well.

          Tyler Lafferty added a comment - I have this same issue as well.

          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.

          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.

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

          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.

          Jon Kimball added a comment -

          I have this issue after upgrading to xcode 9.0

          Jon Kimball added a comment - I have this issue after upgrading to xcode 9.0

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

          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.

          hi,

          did someone find a solution for this?

          Elihai Blomberg added a comment - hi, did someone find a solution for this?

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

              Created:
              Updated: