简体   繁体   English

安装Pod后无法建立工作区

[英]Workspace does not build after pod install

I have two swift projects, application and library , where library is a dependency of application . 我有两个快速项目, applicationlibrary ,其中libraryapplication的依赖项。 I have a Podfile configured as so; 我已经配置了一个Podfile

workspace 'myworkspace'
platform :ios, '9.0'

use_frameworks!

target :library do
    project 'library/library.xcproject'
    pod 'GCDWebServer', '~> 3.0'
    target :application do
        project 'application/application.xcproject'
    end
end

After running pod install successfully, I open myworkspace in Xcode, and find application as the currently selected scheme. 成功运行pod install后,我在Xcode中打开myworkspace ,并找到application作为当前选定的方案。 Immediately building results in failure, due to; 由于以下原因,立即构建会导致失败:

No such module 'library' 没有这样的模块“库”

To solve this I need to change the current scheme to library , build, then switch the scheme back to application and it will successfully build. 为了解决这个问题,我需要将当前方案更改为library ,build,然后将该方案切换回application ,它将成功构建。

Questions; 问题;

  1. Is this expected, or a bug in xcode and/or CocoaPods, or have I configured something incorrectly? 这是预期的,还是xcode和/或CocoaPods中的错误,或者我配置不正确?
  2. Does this mean I need to separately build library anytime library source changes occur to reflect those changes in application builds? 这是否意味着我需要在每次发生library源更改以反映application构建中的更改时分别构建library吗?

Xcode 7.3, CocoaPods 1.0.1, repo 的Xcode 7.3的CocoaPods 1.0.1, 回购

Try do the followings: 请尝试执行以下操作:

1.Open the 'xxx.xcworkspace' file to run your project. 1.打开“ xxx.xcworkspace”文件以运行您的项目。 Do not open 'xxx.xcodeproj' to run your project again. 不要打开“ xxx.xcodeproj”再次运行您的项目。

2.Product->Clean->Run 2.产品->清洁->运行

3.Add all the pod targets to 'Linked Frameworks and Libraries' in Project -> General 3,将所有pod目标添加到Project-> General中的'Linked Frameworks and Libraries'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM