Skip to content

Using Carthage with Xcode 10.1

Andrew Clunis edited this page Jun 26, 2019 · 3 revisions

If you are using Carthage in lieu of Cocoapods, and you are also stuck behind on Xcode 10.1 due to ABI issues with another dependency, you will need to do a few extra steps to get things working.

You can use Carthage as you normally would, that is, add the following to your Cartfile:

github "https://github.com:RoverPlatform/rover-campaigns-ios" ~> 3.0.1

However, you need to do a couple of extra things in order to successfully run carthage update.

  1. Create an Xcode configuration file to override the Swift language version back to 4.2. Create it in your project directory, perhaps naming it something like xcode10_1.xcconfig. Its contents need only be:
SWIFT_VERSION=4.2
  1. Do a carthage update, but specifying the following extra environment variables:
XCODE_XCCONFIG_FILE=`pwd`/xcode10_1.xcconfig carthage update --platform ios --verbose

As you can see, it is important that the xcconfig file path be specified with an absolute path, not a relative one.

Note that this is assuming you have Xcode 10.1 set as your default toolchain (either by being the only installed Xcode or by you using xcode-select to change it globally). However, you may also use the DEVELOPER_DIR environment variable to specify it for just the single command.

  1. Within your project, you will need to differ from the standard Rover installation instructions in that you must import individual Rover Campaigns frameworks (RoverFoundation, RoverData, RoverExperiences, RoverUI, etc.) in lieu of a single RoverCampaigns import, which is a cocoapods-ism).
Clone this wiki locally