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

Xcode PlugIn can't properly build an IPA when the "Info.plist File" build setting contains a variable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • xcode-plugin
    • None

      Xcode PlugIn can't properly build an IPA when the "Info.plist File" build setting contains a variable like this:

      Info.plist File $(PROJECT_NAME)/Resources/Info.plist

      When using a such setting, we got this in the log:

      Output directory: '/Users/Shared/Jenkins/Home/jobs/FooBar Mobile Application/workspace/build/FooBarMobile-Release-$(PROJECT_NAME)/Resources/Info.plist.ipa'
      ...
      + /usr/bin/zip --symlinks --verbose --recurse-paths /Users/Shared/Jenkins/Home/jobs/FooBar Mobile Application/workspace/build/FooBarMobile-Release-$(PROJECT_NAME)/Resources/Info.plist.ipa .
      Program /usr/bin/zip returned 15 : [zip I/O error: No such file or directory
      zip error: Could not create output file (/Users/Shared/Jenkins/Home/jobs/FooBar Mobile Application/workspace/build/FooBarMobile-Release-$(PROJECT_NAME)/Resources/Info.plist.ipa)
      ]
      error: Unable to create '/Users/Shared/Jenkins/Home/jobs/FooBar Mobile Application/workspace/build/FooBarMobile-Release-$(PROJECT_NAME)/Resources/Info.plist.ipa'
      Failed to build /Users/Shared/Jenkins/Home/jobs/FooBar Mobile Application/workspace/build/FooBarMobile-Release-$(PROJECT_NAME)/Resources/Info.plist.ipa
      

      So could you add variable support for this build IPA task, please? Thank you very much.

          [JENKINS-15941] Xcode PlugIn can't properly build an IPA when the "Info.plist File" build setting contains a variable

          Hi everyone. I need this bug/feature so much that I'm willing to pay 5.00 bucks for it.
          This offer is registered at FreedomSponsors (http://www.freedomsponsors.org/core/issue/149/xcode-plugin-cant-properly-build-an-ipa-when-the-infoplist-file-build-setting-contains-a-variable).
          Once you solve it (according to the acceptance criteria described there), just create a FreedomSponsors account and mark it as resolved (oh, you'll need a Paypal account too)
          I'll then check it out and will gladly pay up!

          If anyone else would like to throw in a few bucks to elevate the priority on this issue, you should check out FreedomSponsors!

          Pulkit Singhal added a comment - Hi everyone. I need this bug/feature so much that I'm willing to pay 5.00 bucks for it. This offer is registered at FreedomSponsors ( http://www.freedomsponsors.org/core/issue/149/xcode-plugin-cant-properly-build-an-ipa-when-the-infoplist-file-build-setting-contains-a-variable ). Once you solve it (according to the acceptance criteria described there), just create a FreedomSponsors account and mark it as resolved (oh, you'll need a Paypal account too) I'll then check it out and will gladly pay up! If anyone else would like to throw in a few bucks to elevate the priority on this issue, you should check out FreedomSponsors!

          Jordan Perry added a comment -

          I was able to workaround this by setting Marketing Version and Technical Version to ${BUILD_NUMBER}. This makes it to where the ipa gets the jenkins build number at the end. This might not be what you desire, but I figured I'd share.

          Jordan Perry added a comment - I was able to workaround this by setting Marketing Version and Technical Version to ${BUILD_NUMBER}. This makes it to where the ipa gets the jenkins build number at the end. This might not be what you desire, but I figured I'd share.

          The problem are not variables inside the Info.plist, but the variables used in Build Settings to define the path of the Info.plist file.

          Francis Labrie added a comment - The problem are not variables inside the Info.plist, but the variables used in Build Settings to define the path of the Info.plist file.

          Pulkit Singhal added a comment - - edited

          I don't think I attached the logs from my end before: https://gist.github.com/pulkitsinghal/4700158

          I think for me the primary problem was that the script in my "Run Script" phase wasn't being handled properly by the xcode plugin. I don't think it was being executed at all.

          # Auto Increment Version Script
          buildPlist=${INFOPLIST_FILE}
          CFBuildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBuildNumber" $buildPlist)
          CFBuildNumber=$(($CFBuildNumber + 1))
          /usr/libexec/PlistBuddy -c "Set :CFBuildNumber $CFBuildNumber" $buildPlist
          CFBuildDate=$(date)
          /usr/libexec/PlistBuddy -c "Set :CFBuildDate $CFBuildDate" $buildPlist
          

          I removed it and my Jenkins builds stopped failing but it would still be nice to get this plugin in better shape so it can handle such use cases.

          Pulkit Singhal added a comment - - edited I don't think I attached the logs from my end before: https://gist.github.com/pulkitsinghal/4700158 I think for me the primary problem was that the script in my "Run Script" phase wasn't being handled properly by the xcode plugin. I don't think it was being executed at all. # Auto Increment Version Script buildPlist=${INFOPLIST_FILE} CFBuildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBuildNumber" $buildPlist) CFBuildNumber=$(($CFBuildNumber + 1)) /usr/libexec/PlistBuddy -c "Set :CFBuildNumber $CFBuildNumber" $buildPlist CFBuildDate=$(date) /usr/libexec/PlistBuddy -c "Set :CFBuildDate $CFBuildDate" $buildPlist I removed it and my Jenkins builds stopped failing but it would still be nice to get this plugin in better shape so it can handle such use cases.

          lacostej added a comment -

          Could it be because the variables were not expanded properly ? This was improved in 1.3.3 released this morning. Please try again.

          lacostej added a comment - Could it be because the variables were not expanded properly ? This was improved in 1.3.3 released this morning. Please try again.

          Will this new release appear in updates in Jenkins PlugIns Manager? I can't build and install it myself.

          Francis Labrie added a comment - Will this new release appear in updates in Jenkins PlugIns Manager? I can't build and install it myself.

          lacostej added a comment -

          The release will appear in the update manager within 24h I guess.

          lacostej added a comment - The release will appear in the update manager within 24h I guess.

          Markus Dieterle added a comment - - edited

          Hi there,

          we are having the same issue, also with the latest xcode plugin version (1.3.3).

          Building without having checked 'Build IPA' works perfectly.
          When checking building IPA the job fails, because the plugin cannot resolve the info.plist file path as it contains a variable.

          Xcode itself can perfectly resolve the variable (e.g. at Build Settings->Packaging->Info.plist, it shows up the correct value. When I doublelclick the value I can see the used Variable in my case $(TARGET_NAME)) so it looks like a problem of the plugin.

          From the log for example:
          Marketing version (CFBundleShortVersionString) found in project configuration: $(TARGET_NAME)/XYZ-Info.plist

          When I replace the variable by the hardcoded value in XCode (or in the xcodeproj/project.pbxproj file), the Job can build the ipa succesfully.

          regards

          Markus Dieterle added a comment - - edited Hi there, we are having the same issue, also with the latest xcode plugin version (1.3.3). Building without having checked 'Build IPA' works perfectly. When checking building IPA the job fails, because the plugin cannot resolve the info.plist file path as it contains a variable. Xcode itself can perfectly resolve the variable (e.g. at Build Settings->Packaging->Info.plist, it shows up the correct value. When I doublelclick the value I can see the used Variable in my case $(TARGET_NAME)) so it looks like a problem of the plugin. From the log for example: Marketing version (CFBundleShortVersionString) found in project configuration: $(TARGET_NAME)/XYZ-Info.plist When I replace the variable by the hardcoded value in XCode (or in the xcodeproj/project.pbxproj file), the Job can build the ipa succesfully. regards

          Frank Mueller added a comment -

          Seems to be a DUPLICATE of JENKINS-15708

          Frank Mueller added a comment - Seems to be a DUPLICATE of JENKINS-15708

            Unassigned Unassigned
            flabrie Francis Labrie
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: