【问题标题】:Archive build with split pods across app and watchkit extension跨应用程序和 watchkit 扩展使用拆分 pod 归档构建
【发布时间】:2015-07-27 12:34:15
【问题描述】:

我一直无法让 Cocoapods 构建一个可部署的 iOS 应用程序,该应用程序需要不同的 pod 和 watchkit 扩展。我尝试了另一个线程中建议的格式:Include pods in main target and not in WatchKit extension

但它有很多失败,包括找不到标题。这是我能得到的最接近的:

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

link_with 'RailTime-WatchKit-Extension'

pod 'Reachability'
pod 'IGInterfaceDataTable'

target :'RailTime', :exclusive=>true do
    pod 'ASIHTTPRequest', '~> 1.8.2'
    pod 'BPXLUUIDHandler', '~> 0.0.1'
    pod 'MBProgressHUD', '~> 0.9'
    pod 'Appirater', '~> 2.0.4'
end

这适用于模拟器,但尝试在设备上安装时失败。第一个错误是:

ld:找不到 -lPods-RailTime-WatchKit-Extension 的库

我现在正在使用最新的 Cocoapods .37。执行 pod 安装时不会产生错误。

任何帮助将不胜感激!

【问题讨论】:

    标签: ios xcode6 cocoapods watchkit


    【解决方案1】:

    这是我用于 WatchKit 应用的一般格式。看看这是否有帮助:

    source 'https://github.com/CocoaPods/Specs.git'
    
    target 'RailTime-WatchKit-Extension' do
    
    link_with 'RailTime-WatchKit-Extension'
    
    pod 'Reachability'
    pod 'IGInterfaceDataTable'
    
    end
    
    target :'RailTime' do
    
    link_with 'RailTime'
    
    pod 'ASIHTTPRequest', '~> 1.8.2'
    pod 'BPXLUUIDHandler', '~> 0.0.1'
    pod 'MBProgressHUD', '~> 0.9'
    pod 'Appirater', '~> 2.0.4'
    
    end
    

    【讨论】:

    • 谢谢迈克。我看到另一个建议,我用“pod init”重新启动,然后填写所有内容。我这样做了,它奏效了!虽然我不知道为什么。这是我现在已经成功部署我的应用程序的内容:平台:ios,'8.2' source 'github.com/CocoaPods/Specs.git' target 'RailTime' do pod 'Reachability' pod 'ASIHTTPRequest','~> 1.8.2' pod 'BPXLUUIDHandler' , '~> 0.0.1' pod 'MBProgressHUD', '~> 0.9' pod 'Appirater', '~> 2.0.4' 结束目标 'RailTime-WatchKit-Extension' 做 pod 'Reachability' pod 'IGInterfaceDataTable' 结束目标'RailTime-WatchKit-App' 结束
    【解决方案2】:

    好的,解决方案非常简单,尽管我不确定它为什么会起作用。正如另一个线程中所建议的,我做了一个“pod init”,它现在创建了一个对多个目标了解的模板。然后我就填了!这是我现在拥有的:

    platform :ios, '8.2'
    source 'https://github.com/CocoaPods/Specs.git'
    
    target 'RailTime' do
        pod 'Reachability'
        pod 'ASIHTTPRequest', '~> 1.8.2'
        pod 'BPXLUUIDHandler', '~> 0.0.1'
        pod 'MBProgressHUD', '~> 0.9'
        pod 'Appirater', '~> 2.0.4'
    end
    
    target 'RailTime-WatchKit-Extension' do
        pod 'Reachability'
        pod 'IGInterfaceDataTable'
    end
    
    target 'RailTime-WatchKit-App' do
    
    end
    

    【讨论】:

      猜你喜欢
      • 2015-01-27
      • 1970-01-01
      • 2019-01-29
      • 1970-01-01
      • 1970-01-01
      • 2016-03-10
      • 1970-01-01
      • 2011-10-16
      • 2015-05-19
      相关资源
      最近更新 更多