Cocoapods安装相同的pod多个目标(UITest目标的问题)

时间:2015-12-17 14:27:20

标签: ios xcode cocoapods xcode-ui-testing

我使用此示例为不同的目标安装相同的pod

参考此示例博客文章:

http://natashatherobot.com/cocoapods-installing-same-pod-multiple-targets/

# Podfile

platform :ios, '8.0'
source 'https://github.com/CocoaPods/Specs.git'

link_with ['YourProject']

workspace 'YourProject.xcworkspace'
xcodeproj 'YourProject.xcodeproj'

def shared_pods

    #shared pods

end

def testing_pods

    #shared testing pods

end

target 'YourProject' do
    shared_pods
end

target 'YourProjectTests' do
    shared_pods
    testing_pods
end

target 'YourProjectUITests' do
    shared_pods
    testing_pods
end

但我最终会在YourProjectUITests目标中链接问题:

Undefined symbols for architecture x86_64:

  "_OBJC_CLASS_$_GAI", referenced from:
      objc-class-ref in Utility.o
  "_OBJC_CLASS_$_GAIDictionaryBuilder", referenced from:
      objc-class-ref in HomeViewController.o

  "_OBJC_CLASS_$_NewRelicAgent", referenced from:
      objc-class-ref in AppDelegate.o
  "_kGAIHitType", referenced from:

使用可可豆荚0.39.0& xcode 7.2

我打算尝试删除pod.lock&重新安装pod ..

当我删除pod配置中的UITestTarget时,我不再有任何冲突

0 个答案:

没有答案