【问题标题】:Adding new target membership to files causes "No such module" and "Command CompileSwiftSources failed with a nonzero exit code"向文件添加新的目标成员身份会导致“没有这样的模块”和“Command CompileSwiftSources failed with a nonzero exit code”
【发布时间】:2019-02-27 05:32:15
【问题描述】:

我在自定义键盘扩展中使用 Alamofire 和 SwiftyJSON。我在视图中创建了一个键盘并将其放置在视图控制器中。我想使用这些相同的文件来表示键盘,所以我创建了一个新的目标“键盘”并将目标成员身份添加到键盘扩展和 BibleKeyboardView.swift 文件的项目中。但是,一旦我添加了 Target Membership,我就会收到错误 No such module AlamofireCommand CompileSwiftSources failed with a nonzero exit code。即使我关闭Keyboard 的目标成员资格,它仍然有Command CompileSwiftSources failed with a nonzero exit code。我也用 .xcworkspace 文件打开。

我试过了:

  • 清洁
  • 改造项目
  • 正在运行pod install

有人知道发生了什么吗?

文件结构、目标成员和错误的图片如下:

【问题讨论】:

  • 再次尝试使用pod install 命令并检查。
  • 这是 Alamofire 的错误,而不是 BibleKeyboard.swift 文件,重新安装帖子一次
  • 请用您的 swift 版本验证 alamofire pod 版本。由于最大时间 pod 文件不支持当前的 swift 版本,所以我们必须更新 pod 文件版本。

标签: ios swift cocoapods alamofire custom-keyboard


【解决方案1】:

提交这个问题后,我灵光一闪。

我的Podfile原来有

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'BibleKeyboard-iPad' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
   use_frameworks!

   # Pods for BibleKeyboard-iPad
   pod 'Alamofire'
   pod 'SwiftyJSON'

end

但我需要添加

target 'Keyboard' do
    use_frameworks!

    pod 'Alamofire'
    pod 'SwiftyJSON'

end

【讨论】:

    猜你喜欢
    • 2022-12-28
    • 2018-12-12
    • 2020-06-23
    • 2023-03-29
    • 2019-03-27
    • 1970-01-01
    • 1970-01-01
    • 2020-02-23
    • 2021-07-16
    相关资源
    最近更新 更多