Building in Xcode vs Circle CI

codedeploy
xcode
circle.yml
xcodebuild

#1

I have an app that I have no issues building and running using Xcode (and shipping to iTunes, etc), however it fails when building on Circle CI due to this error: cannot force unwrap value of non-optional type ‘String’

Looking at the log, I see that it occurs when attempting to compile NSURL+OAuthSwift.swift

▸ Compiling NSURL+OAuthSwift.swift

:x: /Users/distiller/healthapp-cloud/iosApp/Health/NSURL+OAuthSwift.swift:21:29: cannot force unwrap value of non-optional type ‘String’

    if absoluteURLString!.hasSuffix("?") {
       ~~~~~~~~~~~~~~~~~^

:x: /Users/distiller/healthapp-cloud/iosApp/Health/NSURL+OAuthSwift.swift:22:51: cannot force unwrap value of non-optional type ‘String’

        absoluteURLString = (absoluteURLString! as NSString).substringToIndex(absoluteURLString!.utf16.count - 1)
                             ~~~~~~~~~~~~~~~~~^

:x: /Users/distiller/healthapp-cloud/iosApp/Health/NSURL+OAuthSwift.swift:25:42: cannot force unwrap value of non-optional type ‘String’

    let URLString = absoluteURLString! + (absoluteURLString!.rangeOfString("?") != nil ? "&" : "?") + queryString
                    ~~~~~~~~~~~~~~~~~^

▸ Compiling OAuth2Swift.swift

:x: /Users/distiller/healthapp-cloud/iosApp/Health/OAuth2Swift.swift:123:64: cannot force unwrap value of non-optional type ‘String’

    parameters["redirect_uri"] = callbackURL.absoluteString!.safeStringByRemovingPercentEncoding

I’ve walked through the basic CircleCI docs (https://circleci.com/docs/ios-builds-on-os-x/) and followed the directions. I noticed that a file with extension .xcscheme is supposed to be created in order to share the scheme. However, when I follow the directions in the official docs, this file is not created. Instead, I see something with an .xcuserstate file extension instead.

Any suggestions about where I should start looking to correct this issue?


#2

Hello,

Just to confirm, are you able to reproduce this failure locally?

Also, it seems you may need to add the .xcscheme file manually for your project.

Can you check that it was committed to your repository?


#3