缺少单元测试所需的模块 'Firebase'

Missing required module 'Firebase' for Unit test

我将单元测试目标添加到现有项目,当我 @testable import Product_Module_Name 在测试 class 时我得到

Missing required module 'Firebase'

我在项目中使用firebase pod 尝试在构建设置中添加HEADER_SEARCH_PATHS = "${PODS_ROOT}/Firebase/CoreOnly/Sources"并添加

target 'TestTargetName' do
  inherit! :search_paths
end

在 pod 文件中。 但仍然出现错误 缺少必需的模块 'Firebase'

target 'GRCReportsTests' do
  inherit! :search_paths
  pod 'Firebase/Messaging'
end

这解决了我的问题