Common iOS 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:

  1. Select the build you’d like to rebuild.

  2. Navigate to the build’s Details.

    The Build details screen

  3. The Rebuild without Cache button 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:

  1. Clone your repo into a new location / folder on your machine.

  2. Double check that you’re building the same target and scheme as identified in buddybuild.

  3. 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.

8.png

9.png

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.

3.jpg

Share your schemes

Sharing your schemes ensures that buddybuild uses the correct build configurations (like test targets) for your builds.

4.jpg

To share your scheme:

  1. Open Xcode.

  2. Select Product > Scheme > Edit Scheme… (or ⌘<).

  3. Select the checkbox(es) associated with the scheme(s) you’d like to share.

Note
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.

5.jpg

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.

The Test Settings screen

Double check your third party dependencies

CocoaPods

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. Without the 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 .gitignore.

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.

Carthage

Make sure that the Carthage version that you set and use locally matches the one specified in your app settings in buddybuild.

The Build Settings screen

Also make sure that your Cartfile and 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:

  1. Navigate to the build log page.

  2. The Download logs dropdown Click Download logs on the right side of the page.

  3. Select an available log to download.

  4. 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 support@buddybuild.com — we’re here to help!

results matching ""

    No results matching ""