向文件添加新目标成员资格会导致“没有此类模块”和“Command CompileSwiftSources失败并返回非零退出代码”

问题描述 投票:0回答:1

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

我试过了:

  • 清洁的
  • 重建项目
  • 运行pod install

任何人都知道发生了什么?

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

enter image description here enter image description here enter image description here

ios swift cocoapods alamofire custom-keyboard
1个回答
0
投票

我提交这个问题后,我有一丝灵感。

我的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
© www.soinside.com 2019 - 2024. All rights reserved.