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

get a "non-existing directory" problem when making an IPA after building a workspace.

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • xcode-plugin
    • None
    • Xcode 4.6.1

      I'm using cocoapods for dependency management. It requires that apps get build using a workspace file, instead of a regular project file. And it adds a "Pods" project into that workspace, which is used by my app.

      So, in my xcode settings in the Jenkins job, the only things I set are the "schema" and "workspace" settings. It builds the app just fine, but the "Build IPA" step fails.

      The message that I get is:
      Cannot remove *.ipa files from a non-existing directory: /Users/jenkins/.jenkins/jobs/myapp/workspace/build/-iphoneos

      So, it appears that it expects my app to exist in a directory named "build", relative to my project. And since I'm not specifying configuration, there's no "Release" in front of the "-iphoneos" part of the path.

      So, is there anything I can do to fix this?

          [JENKINS-17457] get a "non-existing directory" problem when making an IPA after building a workspace.

          david clark added a comment -

          I am having a similar issue. I am not using cocoapods, and I have specified a value for configuration, but I have set it to ${Environment} a variable that I set earlier. The message that I get is:

          Cannot remove *.ipa files from a non-existing directory: /Users/Shared/Jenkins/Home/jobs/HotelSearch_iPhone_stage/workspace/build/${Environment}-iphoneos

          Environment is set to Stage and the directory /Users/Shared/Jenkins/Home/jobs/HotelSearch_iPhone_stage/workspace/build/Stage-iphoneos does exist.

          BTW: for your issue Dan, as a workaround, what happens if you do just specify Release for configuration? Does it break the workspace build?

          david clark added a comment - I am having a similar issue. I am not using cocoapods, and I have specified a value for configuration, but I have set it to ${Environment} a variable that I set earlier. The message that I get is: Cannot remove *.ipa files from a non-existing directory: /Users/Shared/Jenkins/Home/jobs/HotelSearch_iPhone_stage/workspace/build/${Environment}-iphoneos Environment is set to Stage and the directory /Users/Shared/Jenkins/Home/jobs/HotelSearch_iPhone_stage/workspace/build/Stage-iphoneos does exist. BTW: for your issue Dan, as a workaround, what happens if you do just specify Release for configuration? Does it break the workspace build?

          lacostej added a comment -

          Could you try with 1.3.3 ? Variable expansion was improved.

          lacostej added a comment - Could you try with 1.3.3 ? Variable expansion was improved.

          Wil Ferrel added a comment - - edited

          I have received this error also with version 1.4.1 has this been addressed or is there a workaround?

          Build directory does not exist at /Users/Shared/Jenkins/Home/jobs/xxxxxxx/workspace/build/Release-iphoneos. Potential configuration
          

          This is a project using Cocoapods. If I deselect build ipa the build succeeds.

          any suggestions @lacostej

          Wil Ferrel added a comment - - edited I have received this error also with version 1.4.1 has this been addressed or is there a workaround? Build directory does not exist at /Users/Shared/Jenkins/Home/jobs/xxxxxxx/workspace/build/Release-iphoneos. Potential configuration This is a project using Cocoapods. If I deselect build ipa the build succeeds. any suggestions @lacostej

          Esteban Bouza added a comment - - edited

          I am having the same issue building a project with Cocoapods. @Wil Ferrel as a workaround what you can do meanwhile is to set "Build output directory" to ${WORKSPACE}/build/
          This will place the built product in a location the XCode plugin can find later for the ipa.

          Esteban Bouza added a comment - - edited I am having the same issue building a project with Cocoapods. @Wil Ferrel as a workaround what you can do meanwhile is to set "Build output directory" to ${WORKSPACE}/build/ This will place the built product in a location the XCode plugin can find later for the ipa.

          lacostej added a comment -

          A project exhibiting the issue

          lacostej added a comment - A project exhibiting the issue

          lacostej added a comment - - edited

          Here are my findings so far:

          1. if we don't specify the -configuration argument, as the plugin doesn't try to infer xcodebuild defaults configuration for the command line, the plugin creates an invalid buildDirectory
          2. we could try to extract this information from the project/workspace, but I haven't managed to get xcodebuild to behave as it says it should when building a project without specifying the configuration (I mailed the xcode-users list about it for clarification, the conversation will appear on http://lists.apple.com/archives/xcode-users/2014/Dec/index.html)
          3. if you don't specify the BUILD_CONFIGURATION_DIR, xcode will build under some temporary directory that isn't under jenkins workspace (DerivedData etc). So even if jenkins created (mkdir) the missing default directory given "default configuration (infered) + buildPlatform" it isn't searching for the build apps under the right directory
            List<FilePath> apps = buildDirectory.list(new AppFileFilter());
          4. the ipa directory will be under the build configuration dir

          I have to think about it more, but I think the simplest is to force the user to specify the BUILD_CONFIGURATION_DIR when selecting the generate IPA option or provide a good default. I am not sure why the other case (let xcode use his own DerivedData dirs) would be useful.

          lacostej added a comment - - edited Here are my findings so far: if we don't specify the -configuration argument, as the plugin doesn't try to infer xcodebuild defaults configuration for the command line, the plugin creates an invalid buildDirectory we could try to extract this information from the project/workspace, but I haven't managed to get xcodebuild to behave as it says it should when building a project without specifying the configuration (I mailed the xcode-users list about it for clarification, the conversation will appear on http://lists.apple.com/archives/xcode-users/2014/Dec/index.html ) if you don't specify the BUILD_CONFIGURATION_DIR, xcode will build under some temporary directory that isn't under jenkins workspace (DerivedData etc). So even if jenkins created (mkdir) the missing default directory given "default configuration (infered) + buildPlatform" it isn't searching for the build apps under the right directory List<FilePath> apps = buildDirectory.list(new AppFileFilter()); the ipa directory will be under the build configuration dir I have to think about it more, but I think the simplest is to force the user to specify the BUILD_CONFIGURATION_DIR when selecting the generate IPA option or provide a good default. I am not sure why the other case (let xcode use his own DerivedData dirs) would be useful.

          tim hepner added a comment -

          I have xcode plugin version 1.4.8 and this is still a problem for me. the duplicate of this bug is marked resolved. Where is the fix? I didn't see it on github.

            • BUILD SUCCEEDED **

          FATAL: Build directory does not exist at /Users/Shared/Jenkins/Home/jobs/ios-RC-debug/workspace/iOS-Client/build/Debug-iphoneos. Potential configuration issue.
          Build step 'Xcode' marked build as failure
          Build step 'Upload to HockeyApp' marked build as failure

          tim hepner added a comment - I have xcode plugin version 1.4.8 and this is still a problem for me. the duplicate of this bug is marked resolved. Where is the fix? I didn't see it on github. BUILD SUCCEEDED ** FATAL: Build directory does not exist at /Users/Shared/Jenkins/Home/jobs/ios-RC-debug/workspace/iOS-Client/build/Debug-iphoneos. Potential configuration issue. Build step 'Xcode' marked build as failure Build step 'Upload to HockeyApp' marked build as failure

          lacostej added a comment -

          Sorry for the misunderstanding, I marked the other one as resolved because it was resolved as "duplicate of this issue". When they are duplicate, I don't consider their status meaningful.

          As for the issue itself, the last comment of mine describes the current state of the issue. I haven't concluded on what to do yet. Any feedback on #comment-217588 is appreciated

          lacostej added a comment - Sorry for the misunderstanding, I marked the other one as resolved because it was resolved as "duplicate of this issue". When they are duplicate, I don't consider their status meaningful. As for the issue itself, the last comment of mine describes the current state of the issue. I haven't concluded on what to do yet. Any feedback on #comment-217588 is appreciated

          Yurii Koval added a comment - - edited

          I had this problem with following configurations:
          In "General build settings" in ".ipa filename pattern" field I had AppName.Version${VERSION}.Build date:${BUILD_DATE}
          Target: AppName
          Configuration: Debug
          Build output directory: empty

          Same error message - "FATAL: Build directory does not exist..."

          After changing ".ipa filename pattern" field to AppName.Build date:${BUILD_DATE} and "Build output directory" to ${WORKSPACE}/build I had error "Warning: --resource-rules has been deprecated in Mac OS X >= 10.10!" which was successfully fixed by adding "$(SDKROOT)/ResourceRules.plist" string in YourProject > Targets > Select your target > Build Settings > Code Signing Resource Rules Path in Xcode (see http://stackoverflow.com/questions/26459911/resource-rules-has-been-deprecated-in-mac-os-x-10-10).
          So now I have correct *.ipa file created.
          Maybe this solution can help someone.

          Yurii Koval added a comment - - edited I had this problem with following configurations: In "General build settings" in ".ipa filename pattern" field I had AppName.Version${VERSION}.Build date:${BUILD_DATE} Target: AppName Configuration: Debug Build output directory: empty Same error message - " FATAL: Build directory does not exist... " After changing ".ipa filename pattern" field to AppName.Build date:${BUILD_DATE} and " Build output directory " to ${WORKSPACE}/build I had error " Warning: --resource-rules has been deprecated in Mac OS X >= 10.10! " which was successfully fixed by adding " $(SDKROOT)/ResourceRules.plist " string in YourProject > Targets > Select your target > Build Settings > Code Signing Resource Rules Path in Xcode (see http://stackoverflow.com/questions/26459911/resource-rules-has-been-deprecated-in-mac-os-x-10-10 ). So now I have correct *.ipa file created. Maybe this solution can help someone.

            Unassigned Unassigned
            dmorrow Dan Morrow
            Votes:
            8 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: