Search code examples
iosswiftalamofirefrank

Frank (iOS acceptance testing framework) can't find Alamofire


I'm trying to set up Frank to test my iOS app. I've followed this tutorial but I get errors when I run frank build. The full output can be found here. The main error I get is:

CompileSwift normal i386 /Users/paymahn/Documents/Lunchr/Lunchr/Lunchr/LoginViewController.swift
    cd /Users/paymahn/Documents/Lunchr/Lunchr
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/paymahn/Documents/Lunchr/Lunchr/Lunchr/LoginViewController.swift /Users/paymahn/Documents/Lunchr/Lunchr/Lunchr/RegisterViewController.swift /Users/paymahn/Documents/Lunchr/Lunchr/Lunchr/HomePageViewController.swift /Users/paymahn/Documents/Lunchr/Lunchr/Lunchr/ViewController.swift /Users/paymahn/Documents/Lunchr/Lunchr/Lunchr/AppDelegate.swift /Users/paymahn/Documents/Lunchr/Lunchr/Lunchr/CurrentUser.swift -target i386-apple-ios7.0 -target-cpu yonah -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk -I /Users/paymahn/Documents/Lunchr/Lunchr/build/Debug-iphonesimulator -F /Users/paymahn/Documents/Lunchr/Lunchr/build/Debug-iphonesimulator -F /Users/paymahn/Documents/Lunchr/Lunchr/build/Debug-iphonesimulator/Pods-Lunchr -F /Users/paymahn/Documents/Lunchr/Lunchr/build/Debug-iphoneos/Pods-Lunchr -g -D COCOAPODS -Xcc -I/Users/paymahn/Documents/Lunchr/Lunchr/build/Lunchr.build/Debug-iphonesimulator/Lunchr.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/paymahn/Documents/Lunchr/Lunchr/build/Lunchr.build/Debug-iphonesimulator/Lunchr.build/Lunchr-generated-files.hmap -Xcc -I/Users/paymahn/Documents/Lunchr/Lunchr/build/Lunchr.build/Debug-iphonesimulator/Lunchr.build/Lunchr-own-target-headers.hmap -Xcc -I/Users/paymahn/Documents/Lunchr/Lunchr/build/Lunchr.build/Debug-iphonesimulator/Lunchr.build/Lunchr-all-target-headers.hmap -Xcc -iquote -Xcc /Users/paymahn/Documents/Lunchr/Lunchr/build/Lunchr.build/Debug-iphonesimulator/Lunchr.build/Lunchr-project-headers.hmap -Xcc -I/Users/paymahn/Documents/Lunchr/Lunchr/build/Debug-iphonesimulator/include -Xcc -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -I/Users/paymahn/Documents/Lunchr/Lunchr/build/Lunchr.build/Debug-iphonesimulator/Lunchr.build/DerivedSources/i386 -Xcc -I/Users/paymahn/Documents/Lunchr/Lunchr/build/Lunchr.build/Debug-iphonesimulator/Lunchr.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -emit-module-doc-path /Users/paymahn/Documents/Lunchr/Lunchr/build/Lunchr.build/Debug-iphonesimulator/Lunchr.build/Objects-normal/i386/LoginViewController~partial.swiftdoc -Onone -module-name Lunchr -emit-module-path /Users/paymahn/Documents/Lunchr/Lunchr/build/Lunchr.build/Debug-iphonesimulator/Lunchr.build/Objects-normal/i386/LoginViewController~partial.swiftmodule -serialize-diagnostics-path /Users/paymahn/Documents/Lunchr/Lunchr/build/Lunchr.build/Debug-iphonesimulator/Lunchr.build/Objects-normal/i386/LoginViewController.dia -emit-dependencies-path /Users/paymahn/Documents/Lunchr/Lunchr/build/Lunchr.build/Debug-iphonesimulator/Lunchr.build/Objects-normal/i386/LoginViewController.d -o /Users/paymahn/Documents/Lunchr/Lunchr/build/Lunchr.build/Debug-iphonesimulator/Lunchr.build/Objects-normal/i386/LoginViewController.o
/Users/paymahn/Documents/Lunchr/Lunchr/Lunchr/LoginViewController.swift:10:8: error: no such module 'Alamofire'
import Alamofire

I have Alamofire installed using CocoaPods. Here's my Podfile:

# Uncomment this line to define a global platform for your project
# platform :ios, '6.0'
use_frameworks!
target 'Lunchr' do
    pod 'SwiftHTTP', :git => "https://github.com/daltoniam/SwiftHTTP.git", :tag => "0.9.1"
    pod 'SocketRocket'
    pod 'Socket.IO-Client-Swift', '~> 1.1'
    pod 'Alamofire', '~> 1.1'
    pod "SwiftyJSON", ">= 2.1.3"
end

target 'LunchrTests' do
    pod 'SwiftHTTP', :git => "https://github.com/daltoniam/SwiftHTTP.git", :tag => "0.9.1"

end

For what it's worth, when I run my app normally (through the iOS simulator) everything works flawlessly. How can I get Frank to recognize Alamofire?


Solution

  • This is probably because you're using CocoaPods and aren't supplying workspace and scheme arguments to frank build. This is a common problem people run into when trying to use Frank and CocoaPods.

    If that's the case, your question is possibly a duplicate of

    How do I install Frank when my project is using Cocoapods?

    See this page for more details.

    http://blog.thepete.net/blog/2012/10/16/frank-with-cocoapods/