"no such module" on Xcode 7 beta 2
Asked Answered
L

2

14

I saw this question, but I am still unable to import a framework and use it inside Xcode 7 beta 2 (7A121l).

So currently I am trying to use Result, via carthage. After adding it to Build Phases/ Link Binary with Binaries and Embed Frameworks I am able to compile successfully, but I get an error stating (yes it says success and then error :S):

No such module 'Result'

On the import:

import Result

func serverRequest() -> Result<String, NSError> {
    ...
}

The build is able to Run and Compile, but I am not able to cmd+click on Result, for example.


Edit 1: On Xcode 6.3.2 it works as expected.

Edit 2: Opened a radar: 21588771

Lima answered 29/6, 2015 at 1:5 Comment(6)
it happened same to my Xcode 7 Beta 2 and ReactiveCocoa. I deleted from embedded framework, add it again, quit Xcode, restart computer. I don't know when but now it doesn't show any code completion error. Weird here too.Chiro
Are you still having this problem on Beta 3?Pea
@AndyIbanez Following the above mentioned approach, it's working.Lima
Make sure you are not having a d'oh moment: check that you have opened the .xcworkspace not the .xcodeprojHi
@TomHoward why would it matter?Lima
It wouldn't necessarily @RuiAAPeres; it is dependent upon how your project is structured. Little background: https://mcmap.net/q/259709/-is-the-project-xcworkspace-file-importantHi
L
6

Neil's answer is right, but there a very subtle difference how you set the FRAMEWORK_SEARCH_PATHS. So after adding it only to Build Phases/ Link Binary with Binaries, my initial setup was like this:

drwxr-xr-x   8 ruiperes  staff    272 29 Jun 08:35 Playground
drwxr-xr-x   5 ruiperes  staff    170 29 Jun 22:08 Playground.xcodeproj
drwxr-xr-x   4 ruiperes  staff    136 29 Jun 00:12 PlaygroundTests
drwxr-xr-x   4 ruiperes  staff    136 29 Jun 00:12 PlaygroundUITests
drwxr-xr-x   8 ruiperes  staff    272 29 Jun 08:42 Result.framework


FRAMEWORK_SEARCH_PATHS = $(SRCROOT)/**

The above is the wrong setup and won't work. The working one below:

drwxr-xr-x   4 ruiperes  staff    136 29 Jun 22:07 Frameworks
drwxr-xr-x   8 ruiperes  staff    272 29 Jun 08:35 Playground
drwxr-xr-x   5 ruiperes  staff    170 29 Jun 22:08 Playground.xcodeproj
drwxr-xr-x   4 ruiperes  staff    136 29 Jun 00:12 PlaygroundTests
drwxr-xr-x   4 ruiperes  staff    136 29 Jun 00:12 PlaygroundUITests


FRAMEWORK_SEARCH_PATHS = $(SRCROOT)/Frameworks/
Lima answered 29/6, 2015 at 21:18 Comment(0)
W
1

You need to make sure that FRAMEWORK_SEARCH_PATHS in the xcodeproj includes the path where Result.framework is.

Whispering answered 29/6, 2015 at 16:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.