当前位置:  开发笔记 > IOS > 正文

Cocoapods将同一个Pod安装到多个目标(带有UITest目标的问题)

如何解决《Cocoapods将同一个Pod安装到多个目标(带有UITest目标的问题)》经验,为你挑选了0个好方法。

我使用此示例为不同的目标安装相同的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时,我不再有任何冲突

推荐阅读
N个小灰流_701
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有