Cocoapods: Problem with Hockeyapp

Created on 18 May 2016  Â·  29Comments  Â·  Source: CocoaPods/CocoaPods

error: Resource "/Users/xxx/Library/Developer/Xcode/DerivedData/xxx-bgszvlzstziakddnkornjorikbox/Build/Products/Adhoc-iphoneos/HockeySDK-Source/HockeySDKResources.bundle" not found. Run 'pod install' to update the copy resources script

example project is attached.

pod-example 2.zip

awaiting input

Most helpful comment

I tried many different configurations for Jenkins:

no custom SYMROOT
no custom BUILD_DIR
CONFIGURATION_BUILD_DIR=${WORKSPACE}/build
-> FAILURE

error: Resource "/Users/Shared/Jenkins/Home/jobs/SECRET/workspace/build/MobileDev-iphoneos/SECRET/SECRET.bundle" not found. Run 'pod install' to update the copy resources script.

no custom SYMROOT
BUILD_DIR=${WORKSPACE}/build
no custom CONFIGURATION_BUILD_DIR
-> FAILURE

* BUILD SUCCEEDED *

FATAL: Build directory does not exist at > /Users/Shared/Jenkins/Home/jobs/SECRET/workspace/SECRET/build/MobileDev-iphoneos. Potential configuration issue.
Build step 'Xcode' marked build as failure
Finished: FAILURE

no custom SYMROOT
BUILD_DIR=${WORKSPACE}/build
CONFIGURATION_BUILD_DIR=${WORKSPACE}/build
-> FAILURE

error: Resource "/Users/Shared/Jenkins/Home/jobs/SECRET/workspace/build/MobileDev-iphoneos/SECRET/SECRET.bundle" not found. Run 'pod install' to update the copy resources script.

no custom SYMROOT
no custom BUILD_DIR
no custom CONFIGURATION_BUILD_DIR
-> FAILURE

* BUILD SUCCEEDED *

FATAL: Build directory does not exist at /Users/Shared/Jenkins/Home/jobs/SECRET/workspace/SECRET/build/MobileDev-iphoneos. Potential configuration issue.
Build step 'Xcode' marked build as failure
Finished: FAILURE

SYMROOT=${WORKSPACE}/build
no custom BUILD_DIR
no custom CONFIGURATION_BUILD_DIR
-> SUCCESS

SYMROOT=${WORKSPACE}/build
BUILD_DIR=${WORKSPACE}/build
no custom CONFIGURATION_BUILD_DIR
-> SUCCESS

SYMROOT=${WORKSPACE}/build
no custom BUILD_DIR
CONFIGURATION_BUILD_DIR=${WORKSPACE}/build
-> FAILURE

error: Resource "/Users/Shared/Jenkins/Home/jobs/SECRET/workspace/build/MobileDev-iphoneos/SECRET/SECRET.bundle" not found. Run 'pod install' to update the copy resources script.

So, in my case, in Jenkins config:

  • SYMROOT must be set
  • BUILD_DIR has no incidence
  • CONFIGURATION_BUILD_DIR must not be set

All 29 comments

I can't reproduce this error when building the given project. Your error mentions a build configuration called "Adhoc" that doesn't even exist in the example, how are you building it to produce that error?

xcodebuild -workspace pod-example.xcworkspace -scheme pod-example -configuration Adhoc clean build CONFIGURATION_BUILD_DIR={ABSOLUTE_PATH}

That also works fine for me, using Xcode 7.3.1. The error seems very strange to me, as the project does not have an "Adhoc" configuration and falls back to building with "Release" when running xcodebuild.

You can try "xcodebuild -workspace pod-example.xcworkspace -scheme pod-example -configuration Release clean build CONFIGURATION_BUILD_DIR=/Users/XXX/XXX/pod-example/build" in terminal, an d you will see a fail.

I see the issue now. By only overwriting CONFIGURATION_BUILD_DIR, the expectations of the copy resources script are no longer met. I think overwriting BUILD_DIR or SYMROOT would be better here.

@mrackwitz should we document somewhere that just overwriting CONFIGURATION_BUILD_DIR no longer works? Seeing also #5323

Yes! I think that would be a good idea. I was thinking that this could be handled by a blog article explaining the new scoping, but that seems to be to temporary to be the only place. We should put that somewhere in the guides as well.

Same issue here with pod ATInternet-iOS-ObjC-SDK/iOS

Yes! I think that would be a good idea. I was thinking that this could be handled by a blog article explaining the new scoping, but that seems to be to temporary to be the only place. We should put that somewhere in the guides as well.

Were the guides updated? Can a link be left here?

I tried many different configurations for Jenkins:

no custom SYMROOT
no custom BUILD_DIR
CONFIGURATION_BUILD_DIR=${WORKSPACE}/build
-> FAILURE

error: Resource "/Users/Shared/Jenkins/Home/jobs/SECRET/workspace/build/MobileDev-iphoneos/SECRET/SECRET.bundle" not found. Run 'pod install' to update the copy resources script.

no custom SYMROOT
BUILD_DIR=${WORKSPACE}/build
no custom CONFIGURATION_BUILD_DIR
-> FAILURE

* BUILD SUCCEEDED *

FATAL: Build directory does not exist at > /Users/Shared/Jenkins/Home/jobs/SECRET/workspace/SECRET/build/MobileDev-iphoneos. Potential configuration issue.
Build step 'Xcode' marked build as failure
Finished: FAILURE

no custom SYMROOT
BUILD_DIR=${WORKSPACE}/build
CONFIGURATION_BUILD_DIR=${WORKSPACE}/build
-> FAILURE

error: Resource "/Users/Shared/Jenkins/Home/jobs/SECRET/workspace/build/MobileDev-iphoneos/SECRET/SECRET.bundle" not found. Run 'pod install' to update the copy resources script.

no custom SYMROOT
no custom BUILD_DIR
no custom CONFIGURATION_BUILD_DIR
-> FAILURE

* BUILD SUCCEEDED *

FATAL: Build directory does not exist at /Users/Shared/Jenkins/Home/jobs/SECRET/workspace/SECRET/build/MobileDev-iphoneos. Potential configuration issue.
Build step 'Xcode' marked build as failure
Finished: FAILURE

SYMROOT=${WORKSPACE}/build
no custom BUILD_DIR
no custom CONFIGURATION_BUILD_DIR
-> SUCCESS

SYMROOT=${WORKSPACE}/build
BUILD_DIR=${WORKSPACE}/build
no custom CONFIGURATION_BUILD_DIR
-> SUCCESS

SYMROOT=${WORKSPACE}/build
no custom BUILD_DIR
CONFIGURATION_BUILD_DIR=${WORKSPACE}/build
-> FAILURE

error: Resource "/Users/Shared/Jenkins/Home/jobs/SECRET/workspace/build/MobileDev-iphoneos/SECRET/SECRET.bundle" not found. Run 'pod install' to update the copy resources script.

So, in my case, in Jenkins config:

  • SYMROOT must be set
  • BUILD_DIR has no incidence
  • CONFIGURATION_BUILD_DIR must not be set

@Coeur Thanks for the investigation. Would you be interested in writing up a paragraph on how to configure Jenkins correctly which we could include in the guides?

It was attempts at fixing CI configuration. I do not know what all those settings do in reality, so I may be giving wrong advices. Let's hear more feedback from @DarrylBayliss, @tlandsmancars, @faken, @Chren, @zinndesign, ...

@Coeur - thanks for looking into this and the detailed write-up... makes me wish we were using Jenkins. Unfortunately, I'm dealing with an inherited in-house app builder application written in Perl. If I omit the overwrite of CONFIGURATION_BUILD_DIR, the build succeeds but the process breaks in multiple other places - so I'm still looking for a solution that allows overwriting that value in settings, e.g.

my %settings = ( VALID_ARCHS             => 'armv6 armv7 i386',
    PROVISIONING_PROFILE    => $plist->{UUID}->value,
    CODE_SIGN_IDENTITY      => $codeSignID,
    CONFIGURATION_BUILD_DIR => "${build_path}/build",
    CONFIGURATION_TEMP_DIR  => "${build_path}/temp",
    VALIDATE_PRODUCT        => 'YES');

Will continue to test on my end, but open to additional feedback from everyone - especially anyone who's managed to make this work with a custom CONFIGURATION_BUILD_DIR setting.

As i lost 1.5 day on this myself (one of the cases where you know _exactly_ what to google only after you fix it), i can add some knowledge: The PODS_CONFIGURATION_BUILD_DIR env used in "Copy Pods Resources" step (that is Pods-*-resources.sh script) ignores CONFIGURATION_BUILD_DIR and is constructed freshly from $BUILD_DIR - see any related xcconfig in Pods. So in my case setting BUILD_DIR did the right thing. The only disadvantage is a need for constructing an equivalent of CONFIGURATION_BUILD_DIR manually - that is adding ${CONFIGURATION}${EFFECTIVE_PLATFORM_NAME} to $BUILD_DIR. The apps and dSYMs land there, not in BUILD_DIR directly.

I'm seeing the same error with HockeyApp as reported here, but I don't understand from the previous comments what I need to do to get around this error. Sorry if my lack of understanding of cocoapods is preventing me from understanding something that is obvious to everyone else. Would just love to know what I need to do.

@jmfriend are you building through CI or Xcode? Are you aware of manual modifications to the xcodebuild/xctool command?

I’m building through Xcode just by using the Xcode gui. I’m not running xcodebuild/xctool on the command line. I’ve not used those or made manual modifications to those commands.

@jmfriend what's the origin of the project you're building? Hacking someone else's work, or made yourself from scratch? You see, this issue arises when there are modifications to the default xcodebuild invocation. Most frequently through some CI service scripting. So your case is suspicious.

@pavel-zdenek https://github.com/pavel-zdenek, it’s my project (although a couple of other people have worked on it over the years). I originally started the project in 2008, so it’s old. There’s target for building one version of the app that does not work (and gives this hockeyapp error), and another target for building a different version of the app that does work. There’s not any modifications to the xcodebuild.

On 2 Aug 2016, at 18:13, Pavel ZdenÄ›k [email protected] wrote:

@jmfriend https://github.com/jmfriend what's the origin of the project you're building? Hacking someone else's work, or made yourself from scratch? You see, this issue arises when there are modifications to the default xcodebuild invocation. Most frequently through some CI service scripting. So your case is suspicious.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/CocoaPods/CocoaPods/issues/5358#issuecomment-236973977, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGhS7MNdCbfZ_vOboKCjqs3wHZLE0Enks5qb3qxgaJpZM4IhFWC.

Our team is moving away from Jenkins Xcode plugin and are now using a Gymfile direct xcodebuild commands.

turns out my issue was resolved by using a new Xcode scheme. Something in the old scheme was preventing pod libraries from being copied into the build folder.

Just wanted to chime in that @Coeur 's solution worked for me on a teamcity installation where I'm using fastlane's xcodebuild command to produce a simulator build for functional testing. Thanks!

Hit this today after (finally!) upgrading from cocoapods 0.39 -> 1.0.1 and using HockeySDK-Source.
Happens under Jenkins CI with overridden CONFIGURATION_BUILD_DIR
@Coeur 's solution of using SYMROOT instead allows builds to succeed, but we have multiple Jenkins jobs setup like this, all of which look in the CONFIGURATION_BUILD_DIR for the dSYM and app artifacts, which of course then move to a config+platform sub dir.
Guess I'll have to change all my job conifgurations :(
Thanks to everyone on this thread for helping diagnose the issue.
Since this issue is still open, does anybody know if this is likely to be fixed?

After 14h i found this issue, @Coeur 's solution of setting only SYMROOT=${WORKSPACE}/build solve this problem, thanks

@Coeur 's solution of setting only SYMROOT=${WORKSPACE}/build worked for me also. Though I realized that setting CONFIGURATION_BUILD_DIR to "${SYMROOT}/Debug" or similar does not break it. However, I ran into a problem that while archive creation succeeds, the archive is malformed, missing the archive specific root level Info.plist file. Any idea on how to solve this or if it is even related?

Edit: after investigating this further I noticed that in my case SYMROOT is not actually required. So the archive creation succeeded and Info.plist appeared when I did not give any one the parameters: SYMROOT, CONFIGURATION_BUILD_DIR or BUILD_DIR.

Is there any other way to fix this issue?
We really need to specify CONFIGURATION_BUILD_DIR on our application server as we have a workspace approach build server and build agent is allowed to write only to the current workspace.

Any chance to get this fixed?

@dryganets as written above, you can use your own script instead of Jenkins Xcode plugin.
Then all the paths will be your responsibility.

Example:

SCHEME="MyScheme-Debug"
EXPORT_OPTION_PLIST="my_export.plist"
XCODE="/Applications/Xcode.app"
XCODEBUILD="Scripts/xcbuild-safe.sh"

# archiving
ARCHIVE_DAY=$(date +%Y-%m-%d)
ARCHIVE_TIME=$(date +%H.%M.%S)
ARCHIVE_PATH="~/Library/Developer/Xcode/Archives/${ARCHIVE_DAY}/MyApp ${ARCHIVE_DAY} ${ARCHIVE_TIME}.xcarchive"
set -o pipefail \
    && DEVELOPER_DIR="${XCODE}" ${XCODEBUILD} -workspace MyApp.xcworkspace \
    -scheme ${SCHEME} \
    -destination 'generic/platform=iOS' \
    -archivePath "${ARCHIVE_PATH}" \
    clean archive \
    | xcpretty

# exporting
EXPORT_PATH="build/${SCHEME}"
rm -rf "${EXPORT_PATH}"
mkdir -p "${EXPORT_PATH}"
set -o pipefail \
    && DEVELOPER_DIR="${XCODE}" ${XCODEBUILD} -exportArchive \
    -archivePath "${ARCHIVE_PATH}" \
    -exportPath "${EXPORT_PATH}" \
    -exportOptionsPlist "${EXPORT_OPTION_PLIST}"

...where xcbuild-safe.sh is coming from https://github.com/fastlane/fastlane/blob/master/gym/lib/assets/wrap_xcodebuild/xcbuild-safe.sh

Setting BUILD_DIR and removing the CONFIGURATION_BUILD_DIR did the right thing for me.

The only difference with configuration before is that it builds to the different directory.
Now it's ${BUILD_DIR}/${CONFIGURATION} so I need to update the upload my upload publishing script to point to the correct directory.

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

intelliot picture intelliot  Â·  3Comments

pallaviMN picture pallaviMN  Â·  3Comments

spencerkohan picture spencerkohan  Â·  3Comments

marzapower picture marzapower  Â·  3Comments

dawnnnnn picture dawnnnnn  Â·  3Comments