【问题标题】:CocoaPods - iOS, add new OSX target, not linking properly?CocoaPods - iOS,添加新的 OSX 目标,链接不正确?
【发布时间】:2016-03-27 01:22:23
【问题描述】:

我有一个 iOS 应用,现在需要一个 osx 构建。由于它是 80% 左右的共享代码,我已将 OSX 构建添加到项目中。

我的 cocoapods 出现了一些构建错误(在安装 pod 之后,还尝试了更新 pod) 还发现我已经明确向 osx 目标添加了一个 pod,以使其在工作区文件中执行链接并构建阶段魔法。

第一个也是关键的错误:

Target 'Pods-scoreosx' of project 'Pods' was rejected as an implicit dependency for 'Pods_scoreosx.framework' because it doesn't contain platform 'macosx' in its SUPPORTED_PLATFORMS 'iphonesimulator, iphoneos'

有人知道我做错了什么吗?

编辑: 当前 Podspec 文件:

# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'

use_frameworks!

pod 'EmitterKit'
pod 'SwiftDate'
pod 'CocoaAsyncSocket'
pod 'ReactiveKit', '~> 1.0'
pod 'ReactiveUIKit', '~> 1.0'
pod 'ReactiveFoundation', '~> 1.0'
pod 'AsyncSwift'

target 'score' do

end

target 'scoreTests' do

end

target 'scoreUITests' do

end

target 'scoreosx' do
    pod 'EmitterKit'
end

target 'scoreosxTests' do

end

target 'scoreosxUITests' do

end

【问题讨论】:

  • 你能给我们看看 podspec 吗?
  • 当然可以 - 已编辑...

标签: ios macos cocoapods


【解决方案1】:

错误消息说您需要为目标显式配置平台。在目标中设置声明平台会有所帮助。

target 'scoreosx' do
    platform :osx
    pod 'EmitterKit'
end

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-30
    • 2012-11-11
    • 2015-04-08
    • 1970-01-01
    • 1970-01-01
    • 2020-09-28
    • 1970-01-01
    • 2018-01-08
    相关资源
    最近更新 更多