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

Unable to create IPA file for an iOS project (while build status is SUCCESS)

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • xcode-plugin
    • Jenkins 2.7.4, Xcode-plugin 1.4.11

      I am trying to build and package an IPA

      Xcode config is as follows: (only filled-in fields are mentioned)

      General build settings:

      • Target: PIPORetail
      • Generate Archive: yes (checked)
      • Configuration: Release-Prod
      • Pack application and build IPA (checked)
      • .ipa filename pattern: PIPORetail-prod
      • Output directory: ipa

      Code signing & OS X keychain options:

      • Sign IPA at build time (checked)
      • Unlock Keychain (checked) (Path & Password are specified)

      Advanced Xcode build options:

      • Xcode Schema File: PIPORetail
      • Custom xcodebuild arguments: -destination generic/platform=iOS
      • Xcode Workspace File: PIPO
      • Xcode Project Directory: PIPO
      • Build output directory: ${WORKSPACE}/PIPO/build

      The build process works seemingly well; there's a message

      === BUILD TARGET PIPORetail OF PROJECT PIPO WITH CONFIGURATION Release-prod ===

      in the log;

      afterwards there're lines:
      ...

      Create product structure
      /bin/mkdir -p /Users/jenkins/Library/Developer/Xcode/DerivedData/PIPO-anqvovfeckufewcwgvkqrkyjctsw/Build/Intermediates/ArchiveIntermediates/PIPORetail/InstallationBuildProductsLocation/Applications/i-Retail.app
      
      SymLink build/i-Retail.app /Users/jenkins/Library/Developer/Xcode/DerivedData/PIPO-anqvovfeckufewcwgvkqrkyjctsw/Build/Intermediates/ArchiveIntermediates/PIPORetail/InstallationBuildProductsLocation/Applications/i-Retail.app
          cd /Users/jenkins/workspace/i-Retail/iOS/PIPO
          export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
          /bin/ln -sfh /Users/jenkins/Library/Developer/Xcode/DerivedData/PIPO-anqvovfeckufewcwgvkqrkyjctsw/Build/Intermediates/ArchiveIntermediates/PIPORetail/InstallationBuildProductsLocation/Applications/i-Retail.app /Users/jenkins/workspace/i-Retail/iOS/PIPO/build/i-Retail.app
      

      I mention this because this .../PIPO/build/i-Retail.app is later used by plugin on the "package IPA" step, and the problem is - that before it comes to this, that the folder "InstallationBuildProductsLocation" is NO LONGER there ! the link "i-Retail.app" exists, but it is broken.

      Obviously, the plugin enumerates an empty set here (see XCodeBuilder.java, lines 663-672)

                  listener.getLogger().println(Messages.XCodeBuilder_packagingIPA());
                  List<FilePath> apps = buildDirectory.list(new AppFileFilter());
      
                  for (FilePath app : apps) {
      

      and just does nothing ! and completes with a SUCCESS status.

      As of the "non-existent" folder, I've found a description [here](http://stackoverflow.com/questions/19597594/xcode-5-seems-to-delete-installationbuildproductslocation-for-archive) but I am not sure how to apply this knowledge to my situation.

      Any ideas ? Thanks!

          [JENKINS-40186] Unable to create IPA file for an iOS project (while build status is SUCCESS)

          Indeed, i-Retail.app is to be found in the /Library/Developer/Xcode/Archives/2016-12-02/PIPORetail 02.12.16, 14.27.xcarchive/Products/Applications/ folder
          (and some other, with a different date and time in folder and archive names)

          Have not yet found a way to modify the plugin to account for that...

          Kirill Marchuk added a comment - Indeed, i-Retail.app is to be found in the /Library/Developer/Xcode/Archives/2016-12-02/PIPORetail 02.12.16, 14.27.xcarchive/Products/Applications/ folder (and some other, with a different date and time in folder and archive names) Have not yet found a way to modify the plugin to account for that...

          Apparently, this occurs because -archivePath is not specified when xcodebuild is run. Probably would make sense to specify it explicitly ?

          Kirill Marchuk added a comment - Apparently, this occurs because -archivePath is not specified when xcodebuild is run. Probably would make sense to specify it explicitly ?

          Kirill Marchuk added a comment - - edited

          In the meantime, I've managed to compile .ipa and .dSYM as follows:

          • Custom configuration options set to "-destination generic/platform=iOS -archivePath ${WORKSPACE}/PIPO/archive"
          • Unchecked the box "Pack application and build .ipa?"
          • Added a build step to run shell script with content:
          rm -f PIPO/build/PIPORetail-prod.ipa
          rm -f PIPO/build/i-Retail.dsym.zip
          zip -r PIPO/build/i-Retail.dsym.zip PIPO/build/i-Retail.app.dSYM/
          xcodebuild -exportArchive -exportFormat ipa -archivePath "PIPO/archive.xcarchive" -exportPath "PIPO/build/PIPORetail-prod.ipa" -exportProvisioningProfile "AdHoc PIPORetail"
          

          Hope this help someone. Is there any plugin maintainer active for this plugin ?

          Kirill Marchuk added a comment - - edited In the meantime, I've managed to compile .ipa and .dSYM as follows: Custom configuration options set to "-destination generic/platform=iOS -archivePath ${WORKSPACE}/PIPO/archive" Unchecked the box "Pack application and build .ipa?" Added a build step to run shell script with content: rm -f PIPO/build/PIPORetail-prod.ipa rm -f PIPO/build/i-Retail.dsym.zip zip -r PIPO/build/i-Retail.dsym.zip PIPO/build/i-Retail.app.dSYM/ xcodebuild -exportArchive -exportFormat ipa -archivePath "PIPO/archive.xcarchive" -exportPath "PIPO/build/PIPORetail-prod.ipa" -exportProvisioningProfile "AdHoc PIPORetail" Hope this help someone. Is there any plugin maintainer active for this plugin ?

            Unassigned Unassigned
            kmarchuk Kirill Marchuk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: