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

xcrun's deprecated PackageApplication is removed from Xcode 8.3

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: xcode-plugin
    • Labels:
      None
    • Environment:
      Xcode 8.3, macOS 10.12.3
    • Similar Issues:

      Description

      I've updated the Xcode (to version 8.3) today and now all my Jenkins iOS builds are failing.

      This is the error:
      xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH
      It looks like PackageApplication is removed from Xcode 8.3.

      In Xcode 8.2 there was a warning: PackageApplication is deprecated, use `xcodebuild -exportArchive` instead.

       

      Xcode Plugin should change the way it builds IPA file.

       

        Attachments

          Activity

          petra25 Petra A created issue -
          Hide
          andyh200 Andy H added a comment -
          Show
          andyh200 Andy H added a comment - Pull request 76 appears to be a solution to this issue: https://github.com/jenkinsci/xcode-plugin/pull/76/commits/de240a9c2e192fba7d8c6d7509b9e8c00b102307  
          Hide
          fsartori Federico Sartori added a comment -

          Hi all,

                    Is there any ETA for a new plugin version?

          Regards,

           

           

          Show
          fsartori Federico Sartori added a comment - Hi all,           Is there any ETA for a new plugin version? Regards,    
          Hide
          hazam Emanuele Di Saverio added a comment -

          This is really an impacting issue, right now the plugin is useless for iOS development.

          Please verify/accept/publish new plugin as fast as possible

          Show
          hazam Emanuele Di Saverio added a comment - This is really an impacting issue, right now the plugin is useless for iOS development. Please verify/accept/publish new plugin as fast as possible
          Hide
          rorman_globus Ryan Orman added a comment -

          This issue is a blocker for our process and is making Jenkins significantly less useful for us.

          Show
          rorman_globus Ryan Orman added a comment - This issue is a blocker for our process and is making Jenkins significantly less useful for us.
          Hide
          rkarthik1986 Karthik Rangasamy added a comment - - edited

          This is a blocker for us as well.. Using version Plugin version 1.4.11 and XCode 8.1.3

          Show
          rkarthik1986 Karthik Rangasamy added a comment - - edited This is a blocker for us as well.. Using version Plugin version 1.4.11 and XCode 8.1.3
          rorman_globus Ryan Orman made changes -
          Field Original Value New Value
          Priority Critical [ 2 ] Blocker [ 1 ]
          Hide
          hazam Emanuele Di Saverio added a comment -

          Ok posting here my current workaround, adding basically configure the XCode build to create archive, then add an "Execute shell" step and the endof the build with these trhee commands:

          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>teamID</key><string>your team id</string><key>export_method</key><string>ad-hoc</string><key>uploadSymbols</key><true/></dict></plist>' > exportPlist.plist
          
          /usr/bin/xcodebuild -exportArchive -archivePath /path/to/app.xcarchive -exportPath /path/to/build -exportOptionsPlist exportPlist.plist
          
          ditto -c -k --keepParent -rsrc /path/to/build/app.dSYM /path/to/build/app-dSYM.zip
          
          
          Show
          hazam Emanuele Di Saverio added a comment - Ok posting here my current workaround, adding basically configure the XCode build to create archive, then add an "Execute shell" step and the endof the build with these trhee commands: 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>teamID</key><string>your team id</string><key>export_method</key><string>ad-hoc</string><key>uploadSymbols</key><true/></dict></plist>' > exportPlist.plist /usr/bin/xcodebuild -exportArchive -archivePath /path/to/app.xcarchive -exportPath /path/to/build -exportOptionsPlist exportPlist.plist ditto -c -k --keepParent -rsrc /path/to/build/app.dSYM /path/to/build/app-dSYM.zip
          Hide
          shixinyu Steven Shi added a comment -

          Using Xcode 8.3 and this plugin need to be upgrade to fix this issue.

          Blocked our build work.

          Show
          shixinyu Steven Shi added a comment - Using Xcode 8.3 and this plugin need to be upgrade to fix this issue. Blocked our build work.
          Hide
          blahartinger Bryan Lahartinger added a comment -

          Here's a snapshot build that will work for us right now until the PR mentioned above, or my own fork of his that fixes a few bugs , get's accepted merged into the official release.

           

          Show
          blahartinger Bryan Lahartinger added a comment - Here's a snapshot build that will work for us right now until the PR mentioned above, or my own fork of his that fixes a few bugs , get's accepted merged into the official release.  
          Hide
          aphex3k Michael Henke added a comment -

          What is taking so long to resolve this issue?

          Show
          aphex3k Michael Henke added a comment - What is taking so long to resolve this issue?
          Hide
          rashley Ryan Ashley added a comment -

          Has anyone done a diff between Bryan's snapshot the and release version? I can't figure out how.

          Show
          rashley Ryan Ashley added a comment - Has anyone done a diff between Bryan's snapshot the and release version? I can't figure out how.
          Hide
          ravikiran082 Ravikiran Annavarapu added a comment -

          Any update on the latest version of plugin to get released??. I am facing the same issue unable to find "PackageApplication" utility while creating an IPA through Jenkins.

          I tried an alternate way to generate IPA, but it also failed using Jenkins, Whereas the same i am able  to achieve through terminal command prompt.It was able to archive file and creates an IPA file successfully without any issues.

          Steps  followed: (Created a Shell Script under build options in Jenkins)

          1. Go to the path of Xcode Project

            cd <Path of ur Xcode Project>

           

          1. Archive the application
            xcodebuild \
            -scheme {SCHEMA_NAME} \
            -sdk {SDK_NAME} \
            -archivePath {WORKSPACE}\ App.xcarchive \
            -configuration Release \
            PROVISIONING_PROFILE={PROVISIONING_PROFILENAME} \
            archive
          1. Export the archive to an ipa
            xcodebuild \
            -exportArchive \
            -archivePath {WORKSPACE}\ App.xcarchive \
            -exportOptionsPlist {PLIST_PATH}\Enterprise.plist" \
            -exportPath {WORKSPACE}/ipa-dir

           

          Enterprise.plist

          <?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>teamID</key>
          <string>xxxxxxx</string>    --->You can get it in the developer portal.
          <key>compileBitcode</key>
          <false/>
          </dict>
          </plist>

          Using Mac Terminal, i was able to create archive and IPA with latest Xcode 8.3 and mac os 10.12.4. But through Jenkins, i was not able to create archive and IPA.Its saying build succeed but archive is not getting created in the path..Can anyone suggest any solution??

          Show
          ravikiran082 Ravikiran Annavarapu added a comment - Any update on the latest version of plugin to get released??. I am facing the same issue unable to find "PackageApplication" utility while creating an IPA through Jenkins. I tried an alternate way to generate IPA, but it also failed using Jenkins, Whereas the same i am able  to achieve through terminal command prompt.It was able to archive file and creates an IPA file successfully without any issues. Steps  followed: (Created a Shell Script under build options in Jenkins) Go to the path of Xcode Project   cd <Path of ur Xcode Project>   Archive the application xcodebuild \ -scheme {SCHEMA_NAME} \ -sdk {SDK_NAME} \ -archivePath {WORKSPACE}\ App.xcarchive \ -configuration Release \ PROVISIONING_PROFILE={PROVISIONING_PROFILENAME} \ archive Export the archive to an ipa xcodebuild \ -exportArchive \ -archivePath {WORKSPACE}\ App.xcarchive \ -exportOptionsPlist {PLIST_PATH}\Enterprise.plist" \ -exportPath {WORKSPACE}/ipa-dir   Enterprise.plist <?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>teamID</key> <string>xxxxxxx</string>    --->You can get it in the developer portal. <key>compileBitcode</key> <false/> </dict> </plist> Using Mac Terminal, i was able to create archive and IPA with latest Xcode 8.3 and mac os 10.12.4. But through Jenkins, i was not able to create archive and IPA.Its saying build succeed but archive is not getting created in the path..Can anyone suggest any solution??
          Hide
          gauravborole Gaurav Borole added a comment -

          What is taking so long to resolve this issue? This issue is a blocker for our process.

          Show
          gauravborole Gaurav Borole added a comment - What is taking so long to resolve this issue? This issue is a blocker for our process.
          Hide
          bart_at_rogerthat Bart Pede added a comment -

          My company is also blocked by this issue. Is there an ETA for a new plugin version?

          Show
          bart_at_rogerthat Bart Pede added a comment - My company is also blocked by this issue. Is there an ETA for a new plugin version?
          Hide
          lindstedt Magnus Lindstedt added a comment -

          Unfortunately this was also blocking us too long, so now we've removed Jenkins Xcode plugin and added Execute shell with fastlane instead, in our case our unittest have a fastlane like this:

           

          bundle exec fastlane ios test_jenkins

          There was unfortunately several things to fix on Jenkins in order for us to make Fastlane work... but once fixed its running smooth + it is more stable and has easier to understand debug printouts than Jenkins xcode plugin.

          Show
          lindstedt Magnus Lindstedt added a comment - Unfortunately this was also blocking us too long, so now we've removed Jenkins Xcode plugin and added Execute shell with fastlane instead, in our case our unittest have a fastlane like this:   bundle exec fastlane ios test_jenkins There was unfortunately several things to fix on Jenkins in order for us to make Fastlane work... but once fixed its running smooth + it is more stable and has easier to understand debug printouts than Jenkins xcode plugin.
          ravikiran082 Ravikiran Annavarapu made changes -
          Hide
          ravikiran082 Ravikiran Annavarapu added a comment -

          Finally after a lot of trial and error, and struggling for 2 days..i was able to generate an IPA file using Jenkins using custom shell script command.It will be a temporary workaround till Jenkins release a new Xcode plugin version. Need to give Read/Write permissions to Jenkins folder so that it will write some auxiliary files to create Archive.

           

           

           

           

           

          Show
          ravikiran082 Ravikiran Annavarapu added a comment - Finally after a lot of trial and error, and struggling for 2 days..i was able to generate an IPA file using Jenkins using custom shell script command.It will be a temporary workaround till Jenkins release a new Xcode plugin version. Need to give Read/Write permissions to Jenkins folder so that it will write some auxiliary files to create Archive.          
          Hide
          blahartinger Bryan Lahartinger added a comment -

          I updated my PR that fixes the issue folks if you want to help poke that along...https://github.com/jenkinsci/xcode-plugin/pull/78
          You can also use the snapshot build of the plugin to resolve your problems in the interim.

          Show
          blahartinger Bryan Lahartinger added a comment - I updated my PR that fixes the issue folks if you want to help poke that along... https://github.com/jenkinsci/xcode-plugin/pull/78 You can also use the snapshot build of the plugin to resolve your problems in the interim.
          Hide
          aphex3k Michael Henke added a comment -

          I'm not familiar with what a snapshot build entails. Is there any documentation on this somewhere?

           

          Show
          aphex3k Michael Henke added a comment - I'm not familiar with what a snapshot build entails. Is there any documentation on this somewhere?  
          Hide
          blahartinger Bryan Lahartinger added a comment -

          A snapshot build is just a one off build of the plugin code that you can install manually in jenkins (same plugin area where you'd install a plugin normall) vs installing the latest build directly from jenkins. Each time a PR (pull request) to fix an issue is made, jenkins does a build of the plugin to test if everything is alright, that build is posted as a snapshot.

          here's the latest snapshot based on my PR https://jenkins.ci.cloudbees.com/job/plugins/job/xcode-plugin/165/org.jenkins-ci.plugins$xcode-plugin/artifact/org.jenkins-ci.plugins/xcode-plugin/1.4.12-SNAPSHOT/xcode-plugin-1.4.12-SNAPSHOT.hpi

          Instal this hpi file in your jenkins installation if you want to be unblocked until it gets through final review.

          Show
          blahartinger Bryan Lahartinger added a comment - A snapshot build is just a one off build of the plugin code that you can install manually in jenkins (same plugin area where you'd install a plugin normall) vs installing the latest build directly from jenkins. Each time a PR (pull request) to fix an issue is made, jenkins does a build of the plugin to test if everything is alright, that build is posted as a snapshot. here's the latest snapshot based on my PR https://jenkins.ci.cloudbees.com/job/plugins/job/xcode-plugin/165/org.jenkins-ci.plugins$xcode-plugin/artifact/org.jenkins-ci.plugins/xcode-plugin/1.4.12-SNAPSHOT/xcode-plugin-1.4.12-SNAPSHOT.hpi Instal this hpi file in your jenkins installation if you want to be unblocked until it gets through final review.
          blahartinger Bryan Lahartinger made changes -
          Assignee Bryan Lahartinger [ blahartinger ]
          Hide
          aphex3k Michael Henke added a comment -

          Whenever I make changes to the configuration in the Jenkins job it forgets about the globally configured dev id selected and resets it to nothing selected... I guess it needs some work still?

          Show
          aphex3k Michael Henke added a comment - Whenever I make changes to the configuration in the Jenkins job it forgets about the globally configured dev id selected and resets it to nothing selected... I guess it needs some work still?
          Hide
          blahartinger Bryan Lahartinger added a comment - - edited

          that should have been fixed in the last snapshot from build 165...but setting Development Team ID instead of Development Team definitely works...will take a deeper look into the globally configured version.

          Show
          blahartinger Bryan Lahartinger added a comment - - edited that should have been fixed in the last snapshot from build 165...but setting Development Team ID instead of Development Team definitely works...will take a deeper look into the globally configured version.
          Hide
          aphex3k Michael Henke added a comment - - edited

          I did not get it to work with a per-job dev id... It fails with an error that no team with that ID can be found. Using the same id as a global dev id works though... 

          Show
          aphex3k Michael Henke added a comment - - edited I did not get it to work with a per-job dev id... It fails with an error that no team with that ID can be found. Using the same id as a global dev id works though... 
          Hide
          z2670692 Tonin Zhao added a comment -

          Michael Henke I have the same problem.
          FATAL: No global development team or local team ID was configured.

          Show
          z2670692 Tonin Zhao added a comment - Michael Henke I have the same problem. FATAL: No global development team or local team ID was configured.
          Hide
          blahartinger Bryan Lahartinger added a comment -

          Michael Henke should be fixed in latest snapshot if you'd like to try. https://jenkins.ci.cloudbees.com/job/plugins/job/xcode-plugin/166/org.jenkins-ci.plugins$xcode-plugin/artifact/org.jenkins-ci.plugins/xcode-plugin/1.4.12-SNAPSHOT/xcode-plugin-1.4.12-SNAPSHOT.hpi

          Hoping to get this in soon folks. I don't have write access to this repo, just a concerned dev like all of you trying to help out

          Show
          blahartinger Bryan Lahartinger added a comment - Michael Henke should be fixed in latest snapshot if you'd like to try. https://jenkins.ci.cloudbees.com/job/plugins/job/xcode-plugin/166/org.jenkins-ci.plugins$xcode-plugin/artifact/org.jenkins-ci.plugins/xcode-plugin/1.4.12-SNAPSHOT/xcode-plugin-1.4.12-SNAPSHOT.hpi Hoping to get this in soon folks. I don't have write access to this repo, just a concerned dev like all of you trying to help out
          Hide
          z2670692 Tonin Zhao added a comment -

          Bryan Lahartinger I tried the new plugin, it didn't work.
          0 valid identities found
          FATAL: No global development team or local team ID was configured.
           

          Show
          z2670692 Tonin Zhao added a comment - Bryan Lahartinger I tried the new plugin, it didn't work. 0 valid identities found FATAL: No global development team or local team ID was configured.  
          Hide
          blahartinger Bryan Lahartinger added a comment -

          Tonin Zhao - did you configure a development team? It's a new requirement for signing. See the signing section of the configuration settings in your job beside where you configure the keychain.

          Show
          blahartinger Bryan Lahartinger added a comment - Tonin Zhao - did you configure a development team? It's a new requirement for signing. See the signing section of the configuration settings in your job beside where you configure the keychain.
          z2670692 Tonin Zhao made changes -
          Attachment image-2017-05-16-14-24-50-021.png [ 37914 ]
          Hide
          z2670692 Tonin Zhao added a comment -

          Bryan Lahartinger  I have set development team. Is there something wrong?

          Show
          z2670692 Tonin Zhao added a comment - Bryan Lahartinger   I have set development team. Is there something wrong?
          blahartinger Bryan Lahartinger made changes -
          Hide
          blahartinger Bryan Lahartinger added a comment - - edited

          yea that's not the right development team unfortunately

          See the following screenshots for context:
          The first two are variations inside your job configuration. You can choose from the dropdown or specify a team id directly. The drop down will show globally configured development team's that are setup in <your jenkins url base>/configure which is depicted in my third screenshot

          Show
          blahartinger Bryan Lahartinger added a comment - - edited yea that's not the right development team unfortunately See the following screenshots for context: The first two are variations inside your job configuration. You can choose from the dropdown or specify a team id directly. The drop down will show globally configured development team's that are setup in <your jenkins url base>/configure which is depicted in my third screenshot
          Hide
          z2670692 Tonin Zhao added a comment -

          Bryan Lahartinger is there a tutorial ?

          I got a new problem.
          xcodebuild: error: The flag -scheme is required when specifying -archivePath but not -exportArchive.

          Show
          z2670692 Tonin Zhao added a comment - Bryan Lahartinger is there a tutorial ? I got a new problem. xcodebuild: error: The flag -scheme is required when specifying -archivePath but not -exportArchive.
          Hide
          blahartinger Bryan Lahartinger added a comment - - edited

          Tonin Zhao also a new requirement. You must provide a scheme in you job configuration as well. XCode Schema File is the option inside Advanced Xcode build options of your job.

          edit: I'm going to try and see if just -exportArchive can be used vs both it and -archivePath so specifying a scheme isn't a hard requirement when exporting an ipa with this plugin. Currently the way it's designed it is because xcodebuild requires -scheme when using -archivePath. Since this plugin is just a ui wrapper around it we've gotta play by apple's rules.

          Show
          blahartinger Bryan Lahartinger added a comment - - edited Tonin Zhao also a new requirement. You must provide a scheme in you job configuration as well. XCode Schema File is the option inside Advanced Xcode build options of your job. edit : I'm going to try and see if just -exportArchive can be used vs both it and -archivePath so specifying a scheme isn't a hard requirement when exporting an ipa with this plugin. Currently the way it's designed it is because xcodebuild requires -scheme when using -archivePath. Since this plugin is just a ui wrapper around it we've gotta play by apple's rules.
          Hide
          adamsrosco Rosco Adams added a comment -

          Temporary Fix:

          If you have Xcode 8.2.1 or any version below 8.3, copy PackageApplication script from

          Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin

          OR you can Download from this link - https://gist.github.com/anonymous/48f3e4c5ae25313dc0fe10d9ec50c3fc

          Go to finder -

          Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin

          paste the copied/downloaded above file here.

          Show
          adamsrosco Rosco Adams added a comment - Temporary Fix: If you have Xcode 8.2.1 or any version below 8.3, copy PackageApplication script from Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin OR you can Download from this link - https://gist.github.com/anonymous/48f3e4c5ae25313dc0fe10d9ec50c3fc Go to finder - Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin paste the copied/downloaded above file here.
          Hide
          aheritier Arnaud Héritier added a comment -
          Show
          aheritier Arnaud Héritier added a comment - Should be fixed in 2.0.0 by  https://github.com/jenkinsci/xcode-plugin/pull/78
          aheritier Arnaud Héritier made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          z2670692 Tonin Zhao added a comment -

          Bryan Lahartinger I have a new problem. Can you help me? Thanks
          Check dependencies
          No iOS profile matching 'xxx' found: Xcode couldn't find a profile matching 'xxx'. Install the profile (by dragging and dropping it onto Xcode's dock item) or select a different one in the General tab of the target editor.

          Show
          z2670692 Tonin Zhao added a comment - Bryan Lahartinger  I have a new problem. Can you help me? Thanks Check dependencies No iOS profile matching 'xxx' found: Xcode couldn't find a profile matching 'xxx'. Install the profile (by dragging and dropping it onto Xcode's dock item) or select a different one in the General tab of the target editor.
          Hide
          aphex3k Michael Henke added a comment -

          Tonin Zhao Make sure you have your certificates set up and profiles downloaded using Xcode. I had the same error and was able to resolve it in the Xcode account management.

          Show
          aphex3k Michael Henke added a comment - Tonin Zhao Make sure you have your certificates set up and profiles downloaded using Xcode. I had the same error and was able to resolve it in the Xcode account management.
          Hide
          z2670692 Tonin Zhao added a comment -

          Michael Henke Thanks for your method. But I don't think my certificates and profiles have problems. I can use Xcode or  fastlane to archive my application. 

          Show
          z2670692 Tonin Zhao added a comment - Michael Henke Thanks for your method. But I don't think my certificates and profiles have problems. I can use Xcode or  fastlane to archive my application. 

            People

            • Assignee:
              blahartinger Bryan Lahartinger
              Reporter:
              petra25 Petra A
            • Votes:
              18 Vote for this issue
              Watchers:
              26 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: