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

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

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

          Jay Trivedi added a comment -

          gauravborole You need to mention provisioning profile in ExportOptions.plist file.

          Jay Trivedi added a comment - gauravborole You need to mention provisioning profile in ExportOptions.plist file.

          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

          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

          Ronak Patel added a comment -

          scm_issue_link so, now we should be able to use jenkins to create our build successfully, right? 

          Ronak Patel added a comment - scm_issue_link so, now we should be able to use jenkins to create our build successfully, right? 

          Ronak Patel added a comment -

          scm_issue_link what version of jenkins will have this change? nguyenhoang jamesrantmedia

          Ronak Patel added a comment - scm_issue_link  what version of jenkins will have this change? nguyenhoang jamesrantmedia

          nguyen hoang added a comment -

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

          nguyen hoang added a comment - ronakpatel786 I haven't used Jenkins plugins for iOS builds so have no idea about this.

          Jay Trivedi added a comment -

           

          ronakpatel786 , Currently kazuhidet 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.

          Jay Trivedi added a comment -   ronakpatel786 , Currently kazuhidet 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.

          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?

          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?

          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

          kapten_perk: Which xcode version do you use?

          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 kapten_perk : Which xcode version do you use?

          David Eklund added a comment - - edited

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

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

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

              Created:
              Updated: