【问题标题】:Framework not found using cocoapods and tvOS使用 cocoapods 和 tvOS 找不到框架
【发布时间】:2016-05-21 14:34:48
【问题描述】:

我有一个项目有两个目标,一个是 iOS,另一个是 tvOS。在创建一个对他们都适用的 podfile 之后,我正在使用 cocoapods 1.0.0.beta.3 所以苹果电视的东西可以正常工作,我可以很好地构建 iOS 项目,但是在尝试构建 Apple TV 时出现错误应用程序。特别是ld: framework not found Alamofire

这是我的 podfile:

source 'https://github.com/CocoaPods/Specs.git'

def common_pods
  pod 'Alamofire', '~> 3.0'
  pod 'Raven', :git => 'https://github.com/getsentry/raven-objc.git', :tag => '1.0.1'
  pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
  pod 'SDWebImage', '~> 3.7.5'
  pod 'JSQCoreDataKit'
  pod 'MBProgressHUD', :git => 'https://github.com/smejkpa7/MBProgressHUD.git'
end

target 'Proj' do
  use_frameworks!
  platform :ios, '8.0'
  common_pods
end

target 'ProjTvOS' do
  use_frameworks!
  platform :tvos, '9.0'
  common_pods
end

我也收到此警告 ld: warning: directory not found for option '-F/Users/codymace/Library/Developer/Xcode/DerivedData/Proj-gditpcvccsqwvhekifzrooriaezm/Build/Products/Debug-appletvos/Pods-ProjTvOS'

我注意到该框架不存在,因为它实际上是带有下划线而不是破折号的 Pods_ProjTvOS。不过,这就是我从 cocoapods 开箱即用的东西。

我还刚刚注意到 Pod 框架没有被添加到构建目录中。所以我从 iphoneos 目录中复制了它们并成功构建。但后来我在设备上安装时遇到问题,我在想是因为我需要清理项目,但这会删除框架。

顺便说一下,使用 Xcode 7.2.1。

提前感谢您的帮助!

【问题讨论】:

    标签: ios xcode cocoapods tvos


    【解决方案1】:

    我正在使用它,它可以工作

    source 'https://github.com/CocoaPods/Specs.git'
    
    # Uncomment this line to define a global platform for your project
    platform :tvos, '9.0'
    # Uncomment this line if you're using Swift
    use_frameworks!
    
    target 'MyApp' do
    pod 'Alamofire', '~> 3.0'
    pod 'SwiftyJSON'
    end
    
    target 'MyAppTests' do
    pod 'SwiftyJSON'
    end
    
    target 'MyAppUITests' do
    pod 'SwiftyJSON'
    end
    

    我猜你是在打开工作区,而不是项目?!我也在为 tvos 和 xcode 7.3 运行它

    【讨论】:

    • 我不知道为什么这个答案有 0 票,这对我有用!!!谢谢+1
    猜你喜欢
    • 2017-01-17
    • 1970-01-01
    • 2015-12-19
    • 1970-01-01
    • 1970-01-01
    • 2016-04-12
    • 1970-01-01
    • 1970-01-01
    • 2019-07-31
    相关资源
    最近更新 更多