Can't include Objective-C .framework in Xcode 7 UI test target?
Asked Answered
S

0

6

I'm trying to depend on OHHTTPStubs as a framework, from a Swift UI Testing target in Xcode 7.

I built the .framework (via Carthage, but I'm not sure that's relevant?) and dragged it into the "Link binaries with libraries" section under the Build Phases tab of the UI test target.

But when I try and @import OHHTTPStubs in my .swift test case, Xcode tells me No such module 'OHHTTPStubs'.

This should be simple, what am I missing? Here's the project on Github.

Squadron answered 19/6, 2015 at 9:32 Comment(5)
Do you have a bridging header as mentioned here: developer.apple.com/library/ios/documentation/Swift/Conceptual/… ? And why are you using a swift ui testing target? As far as I've seen there should be also an Obj-C taget. (But didn't have the time to try it yet).Caylor
I don't believe I need a bridging header as I'm trying to include a framework that "defines module". And I'm using a Swift testing target because I want to use a Swift testing target—the whole point is to experiment with Swift in a "safe" way by isolating it to the test infrastructure. This should work, as far as I can see.Squadron
@RobertAtkins I read (#32828092) that it is not possible to have OHHTTPStubs working on a UITest target since the test target runs in a "closed" instance. Is this true? I've also tried other framework like github.com/kylef/Mockingjay without success.Cosh
Any update on this topic? @RobertAtkinsVal
Sorry no, gave up on this one long ago.Squadron

© 2022 - 2024 — McMap. All rights reserved.