Common build errors
We’ve put together a quick checklist to help teams troubleshoot the most common causes for build failures.
Here’s what you can to do quickly diagnose and likely resolve build errors:
Rebuild without cache
Caching is one of many techniques used by buddybuild to speed up build times. However, some build failures can be caused by a corrupted or out-of-date cache. Rebuilding without cache is a quick way to clear the cache and rebuild from the most recent committed code.
To do this:
Select the build you’d like to rebuild.
Navigate to the build’s Details.
Click Rebuild without Cache.
Clone your repo and check if your app builds locally
It is important to make sure that there are no discrepancies between your remote branch and local git state.
Buddybuild creates a fresh clone of your code and executes build commands on every commit.
Here’s how to replicate this process and ensure that your remote branch is up to date:
Clone your repo into a new location / folder on your machine.
Double check that you’re building the same target and scheme as identified in buddybuild.
Open Xcode from the new location and simply ⌘B to build your app locally.
Similarly, if you’re experiencing issues when using buddybuild to push to iTunes Connect (for TestFlight or App Store deployments) make sure that you can Archive and Export your build locally as well.
In Xcode you can do this by navigating to Product > Archive then select "Export…" and follow the onscreen instructions to finalize exporting.
And finally, if your builds succeed locally but still fail on
buddybuild, run the same
xcodebuild command from buddybuild on your
Mac to make sure that there are no discrepancies.
Share your schemes
Sharing your schemes ensures that buddybuild uses the correct build configurations (like test targets) for your builds.
To share your scheme:
Select Product > Scheme > Edit Scheme… (or ⌘<).
Select the checkbox(es) associated with the scheme(s) you’d like to share.
|Make sure that you commit and push the changes to your repo so that buddybuild can use them.|
Ensure that your tests pass
If your app has tests, make sure they run successfully on your Mac or local machine.
If your tests are failing locally because of a known issue and you still want to them to run in buddybuild, you can always opt to treat them as warnings. This way, failed tests won’t cause your builds to fail. To do this, go to your App Settings and enable the Treat tests as warnings option.
Double check your third party dependencies
One of the most common causes of build failures occurs when the
Podfile.lock file is missing from your repo. When using CocoaPods, the
Podfile.lock file specifies the exact versions that your app uses.
Podfile.lock file, unexpected versions of CocoaPods might
be used during
pod install on a new repo.
Please double check that the
Podfile.lock file is checked into your
repo, as it oftentimes is in
Alternatively, you can also commit the entire Pods directory into your repo. Buddybuild detects committed pods, automatically skips the pod install step, and uses the Pods exactly as they’re setup locally.
In either case, run
pod install locally, then commit and push the
changes to your repo.
Make sure that the Carthage version that you set and use locally matches the one specified in your app settings in buddybuild.
Also make sure that your
Cartfile.resolved files are
checked into your repo.
Review the build logs
Last, but not least, the build logs that buddybuild collects during a
build and subsequent test runs can contain errors that can help identify
problems in your project. We recommend that you review the test,
simulator, and raw
xcodebuild logs for errors.
To access the logs:
Navigate to the build log page.
Click Download logs on the right side of the page.
Select an available log to download.
Repeat the selection to download all available logs.
Contact buddybuild support
If you’ve followed the steps above and are still unable to find the cause of your build failure, please drop us a line via Intercom or at email@example.com — we’re here to help!