【问题标题】:COCOAPOD file not found for Xcode unit tests only仅针对 Xcode 单元测试未找到 COCOAPOD 文件
【发布时间】:2016-06-08 14:26:05
【问题描述】:

我已经使用 POD 添加了 PLCrashReporter

use_frameworks! 
pod 'PLCrashReporter'

我已在 Briding Header 中导入以下文件以在我的 swift 项目中使用

#import <CrashReporter/CrashReporter.h>
#import <CrashReporter/PLCrashReport.h>

如果我运行该项目,那么我不会遇到任何问题,它会按预期工作

如果我进行 xcode 单元测试,我会收到以下错误 (Xcode->产品->测试)

【问题讨论】:

    标签: ios xcode unit-testing cocoapods plcrashreporter


    【解决方案1】:

    分别为 TargetTargetTests

    添加 pod

    POD 文件中进行以下更改

    target ‘Target’ do
    platform :ios, ‘8.0’
    use_frameworks!
    pod 'PLCrashReporter'
    end
    
    target 'TargetTests' do
        platform :ios, ‘8.0’
        use_frameworks!
        pod 'PLCrashReporter'
    end
    

    转到 TargetTests 的构建设置 并将“Other Linker Flags”的值设置为$(inherited)

    执行 POD 安装,然后执行 Clean Build Folder 并运行

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-10
      • 2016-03-16
      • 2013-06-07
      • 2012-08-17
      相关资源
      最近更新 更多