# iOS app build fails, then is magically fixed on rebuild

**URL:** <https://discuss.circleci.com/t/ios-app-build-fails-then-is-magically-fixed-on-rebuild/4683>\
**Category:** Bug Reports\
**Tags:** ios\
**Created:** [June 20, 2016, 8:20pm UTC](https://discuss.circleci.com/t/ios-app-build-fails-then-is-magically-fixed-on-rebuild/4683 "2016-06-20T20:20:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jordanpwood](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jordanpwood/32/11687_2.png) [@jordanpwood](https://discuss.circleci.com/u/jordanpwood)\
**Post date:** [June 20, 2016, 8:20pm UTC](https://discuss.circleci.com/t/ios-app-build-fails-then-is-magically-fixed-on-rebuild/4683/1 "2016-06-20T20:20:46Z")

</div>

I am having the problem that most of the time we attempt to build our iOS app on circleCI it fails the first time (sometimes 2 times), and then is fixed after hitting the “Rebuild” button (not choosing without cache or the other rebuild option). The failed build ends with:

```auto
▸ Copying BrowZine\ Tests/crawlspec/simple_crawl_to_pdf.yaml
▸ Copying BrowZine\ Tests/test_my_bookshelf.json
▸ Running script 'Copy Pods Resources'
▸ Running script 'Embed Pods Frameworks'
▸ Touching BrowZine\ Tests.xctest
**TEST FAILED**

export LC_CTYPE="en_US.UTF-8"
export XCTOOL_FORCE_TTY="true"
set -o pipefail && xcodebuild -workspace 'browzine.xcworkspace' -scheme 'BrowZine' clean build test -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=latest' CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= PROVISIONING_PROFILE= | tee $CIRCLE_ARTIFACTS/xcode_raw.log | xcpretty --color --report junit --output $CIRCLE_TEST_REPORTS/xcode/results.xml
returned exit code 65

```

While the successful build makes it past this point, like the following:

```auto
▸ Copying BrowZine\ Tests/crawlspec/simple_crawl_to_pdf.yaml
▸ Copying BrowZine\ Tests/test_my_bookshelf.json
▸ Running script 'Copy Pods Resources'
▸ Running script 'Embed Pods Frameworks'
▸ Touching BrowZine\ Tests.xctest
All tests
Test Suite BrowZine Tests.xctest started
BZArticleContentDownloader_Tests
✓ testThatItCallsTheFailBlockWhenHTMLReceivedFromServer (0.005 seconds)

```

Does anyone know why this is happening? Have you seen this as well?!?

---

<div class="post-metadata">

**Author:** ![step](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/step/32/13206_2.png) [@step](https://discuss.circleci.com/u/step)\
**Post date:** [August 17, 2016, 6:46pm UTC](https://discuss.circleci.com/t/ios-app-build-fails-then-is-magically-fixed-on-rebuild/4683/2 "2016-08-17T18:46:10Z")

</div>

We’ve been fighting this for a long time. Various of our tests run and pass before hitting this. Never any test failures.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:34am UTC](https://discuss.circleci.com/t/ios-app-build-fails-then-is-magically-fixed-on-rebuild/4683/3 "2018-06-18T11:34:14Z")

</div>

Closed on June 18, 2018, 11:34am UTC


