【问题标题】:"no such module" on Xcode 7 beta 2Xcode 7 beta 2 上的“没有这样的模块”
【发布时间】:2015-09-15 08:51:44
【问题描述】:

我看到了这个question,但我仍然无法导入框架并在 Xcode 7 beta 2 (7A121l) 中使用它。

所以目前我正在尝试通过 carthage 使用 Result。将其添加到 Build Phases/ Link Binary with BinariesEmbed Frameworks 后,我能够成功编译,但我收到一条错误消息(是的,它表示成功,然后出现错误: S):

No such module 'Result'

关于导入:

import Result

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

构建能够运行和编译,但我无法通过 cmd+单击结果,例如。


编辑 1: 在 Xcode 6.3.2 上,它按预期工作。

编辑 2: 开通雷达:21588771

【问题讨论】:

  • 它发生在我的 Xcode 7 Beta 2 和 ReactiveCocoa 上。我从嵌入式框架中删除,再次添加,退出 Xcode,重新启动计算机。我不知道什么时候,但现在它没有显示任何代码完成错误。这里也很奇怪。
  • 您还在 Beta 3 上遇到这个问题吗?
  • @AndyIbanez 按照上述方法,它正在工作。
  • 确保你没有d'oh时刻:检查你打开的是.xcworkspace而不是.xcodeproj
  • @TomHoward 为什么重要?

标签: ios swift xcode7 carthage xcode7-beta2


【解决方案1】:

Neil 的回答是正确的,但是您设置FRAMEWORK_SEARCH_PATHS 的方式有一个非常细微的差别。所以只添加到Build Phases/ Link Binary with Binaries之后,我的初始设置是这样的:

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)/**

以上设置错误,将无法使用。 下面的工作

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/

【讨论】:

    【解决方案2】:

    您需要确保 xcodeproj 中的FRAMEWORK_SEARCH_PATHS 包含Result.framework 所在的路径。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-19
      • 2018-10-23
      • 2018-01-17
      相关资源
      最近更新 更多