• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • xcode-plugin
    • Jenkins 1.533 and Xcode 1.4 plugin

      After upgrading to 1.4, none of my build configurations functioned. Each of them failed with an NPE in the same location:

      [Package_CM_1_2] $ /usr/bin/xcodebuild -version
      Xcode 5.0
      Build version 5A1412
      Fetching marketing version number (CFBundleShortVersionString) from project.
      [Package_CM_1_2] $ /usr/bin/agvtool mvers -terse1
      No marketing version found (CFBundleShortVersionString).
      Marketing version (CFBundleShortVersionString) found in project configuration: .
      Fetching technical version number (CFBundleVersion) from project.
      [Package_CM_1_2] $ /usr/bin/agvtool vers -terse
      No marketing version found (CFBundleVersion)
      Technical version (CFBundleVersion) found in project configuration: .
      Marketing version (CFBundleShortVersionString) used by Jenkins to produce the IPA:
      Technical version (CFBundleVersion) used by Jenkins to produce the IPA:
      Cleaning build directory: /Development/Jenkins/workspace/Package_CM_1_2/build/Release-iphoneos
      [Package_CM_1_2] $ /usr/bin/security list-keychains -s /Users/buildbot/Library/Keychains/BuildBotCodeSigner.keychain
      [Package_CM_1_2] $ /usr/bin/security default-keychain -d user -s /Users/buildbot/Library/Keychains/BuildBotCodeSigner.keychain
      [Package_CM_1_2] $ /usr/bin/security unlock-keychain -p ******** /Users/buildbot/Library/Keychains/BuildBotCodeSigner.keychain
      [Package_CM_1_2] $ /usr/bin/security show-keychain-info /Users/buildbot/Library/Keychains/BuildBotCodeSigner.keychain
      Keychain "/Users/buildbot/Library/Keychains/BuildBotCodeSigner.keychain" lock-on-sleep timeout=300s
      ===========================================================
      == Available provisioning profiles
      [Package_CM_1_2] $ /usr/bin/security find-identity -p codesigning -v
      1) ***** "****"
      2) ***** "****"
      3) ***** "****"
      3 valid identities found
      == Available SDKs
      [Package_CM_1_2] $ /usr/bin/xcodebuild -showsdks
      OS X SDKs:
      OS X 10.8 -sdk macosx10.8

      iOS SDKs:
      iOS 7.0 -sdk iphoneos7.0

      iOS Simulator SDKs:
      Simulator - iOS 6.1 -sdk iphonesimulator6.1
      Simulator - iOS 7.0 -sdk iphonesimulator7.0

      == Available schemes
      [Package_CM_1_2] $ /usr/bin/xcodebuild -list
      Information about project "CartographicaMobile":
      Targets:
      CartographicaMobile
      CartoMobileTests

      Build Configurations:
      Debug
      Coverage
      Release
      Distribution

      If no build configuration is specified and -scheme is not passed then "Release" is used.

      Schemes:
      CartoMobile
      CartoMobile-Distribution
      CartoMobileUnitTests
      ===========================================================
      FATAL: null
      java.lang.NullPointerException
      at au.com.rayh.XCodeBuilder.perform(XCodeBuilder.java:489)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
      at hudson.model.Build$BuildExecution.build(Build.java:199)
      at hudson.model.Build$BuildExecution.doRun(Build.java:160)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:567)
      at hudson.model.Run.execute(Run.java:1665)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:246)

          [JENKINS-19886] NPE in Xcode plugin

          Dick Ginga added a comment -

          From the user's group I learned that resaving the job will correct this.

          Dick Ginga added a comment - From the user's group I learned that resaving the job will correct this.

          I am having the same issue and had to go back to 1.3.3
          However we need to use the new plugin to be able to use the archive option
          What is the plan to fix this issue or is there some workaround to get it going?

          Reinhard Karbas added a comment - I am having the same issue and had to go back to 1.3.3 However we need to use the new plugin to be able to use the archive option What is the plan to fix this issue or is there some workaround to get it going?

          Jay Graves added a comment -

          I got this same NPE and was able to fix it by putting a pattern for the .ipa filename pattern.

          Jay Graves added a comment - I got this same NPE and was able to fix it by putting a pattern for the .ipa filename pattern.

          I don't think this will help me as the first several xcode projects are used to build third party code and there is no ipa creation involved at all

          Reinhard Karbas added a comment - I don't think this will help me as the first several xcode projects are used to build third party code and there is no ipa creation involved at all

          Zsolt Váradi added a comment -

          I came to the same conslusion as Dick Ginga. Opening the project configuration and saving it provides a workaround.

          The NPE itself is caused by the new "Generate Archive?" option added in 1.4, as projects with earlier configurations don't have this flag, and the plugin doesn't handle this situation. Resaving adds the flag to the config.

          Zsolt Váradi added a comment - I came to the same conslusion as Dick Ginga. Opening the project configuration and saving it provides a workaround. The NPE itself is caused by the new "Generate Archive?" option added in 1.4, as projects with earlier configurations don't have this flag, and the plugin doesn't handle this situation. Resaving adds the flag to the config.

          After saving the jobs again the build worked
          Now I just have a problem how the ipa file is named
          Originally it was $TARGET-$Configuration.$VERSION.ipa, now it seems to be $TARGET.$VERSION.ipa, is this correct?
          We are building from a workspace, so I assume $TARGET is taken from the xCode Schema file name and $VERSION seems to come from the techical version
          Which parameter do I use to get my name back to the original name, is there a variable I can use to get the value for Configuration and use it in the pattern for the ipa file?

          Reinhard Karbas added a comment - After saving the jobs again the build worked Now I just have a problem how the ipa file is named Originally it was $TARGET-$Configuration.$VERSION.ipa, now it seems to be $TARGET.$VERSION.ipa, is this correct? We are building from a workspace, so I assume $TARGET is taken from the xCode Schema file name and $VERSION seems to come from the techical version Which parameter do I use to get my name back to the original name, is there a variable I can use to get the value for Configuration and use it in the pattern for the ipa file?

          pull request of this issue is here: https://github.com/jenkinsci/xcode-plugin/pull/37

          why this pull request is not merged?

          Taiki Sugawara added a comment - pull request of this issue is here: https://github.com/jenkinsci/xcode-plugin/pull/37 why this pull request is not merged?

          Code changed in jenkins
          User: vzsg
          Path:
          src/main/java/au/com/rayh/XCodeBuilder.java
          http://jenkins-ci.org/commit/xcode-plugin/4724a1c79040b9b1f91ce8381adc4a24013a8268
          Log:
          Avoid NPE on plugin version update

          When upgrading from 1.3 to 1.4.x, this configuration key does not yet
          exist, causing every XCode build to break. Added a null check to avoid
          this situation. JENKINS-19886

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: vzsg Path: src/main/java/au/com/rayh/XCodeBuilder.java http://jenkins-ci.org/commit/xcode-plugin/4724a1c79040b9b1f91ce8381adc4a24013a8268 Log: Avoid NPE on plugin version update When upgrading from 1.3 to 1.4.x, this configuration key does not yet exist, causing every XCode build to break. Added a null check to avoid this situation. JENKINS-19886

          Mark Edington added a comment -

          I'm suddenly running into the same issue with 1.4.1. Is there a workaround? Should I downgrade to 1.3.1?

          Mark Edington added a comment - I'm suddenly running into the same issue with 1.4.1. Is there a workaround? Should I downgrade to 1.3.1?

          lacostej added a comment -

          This was released in 1.4.2.

          lacostej added a comment - This was released in 1.4.2.

            Unassigned Unassigned
            gaige Gaige Paulsen
            Votes:
            2 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: