Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
379 views
in Technique[技术] by (71.8m points)

ios - "no such module" on Xcode 7 beta 2

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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/

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...