skip to Main Content

i added Unit test target to existing project, when i @testable import Product_Module_Name in test class i am getting

Missing required module ‘Firebase’

i am using firebase pod in the project
tried adding HEADER_SEARCH_PATHS = "${PODS_ROOT}/Firebase/CoreOnly/Sources" in Build Settings and added

target 'TestTargetName' do
  inherit! :search_paths
end

in pod file.
But still getting error Missing required module ‘Firebase’

2

Answers


  1. Chosen as BEST ANSWER
    target 'GRCReportsTests' do
      inherit! :search_paths
      pod 'Firebase/Messaging'
    end
    

    This solved my issue


  2. I don’t use CocoaPods but SPM.
    For me the issue was with the wrong TEST_HOST value.
    After creating a new project in Xcode 14, the default value was set to:
    TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YourApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/YourApp";
    and it caused the final path to have an extra slash – build/Debug-iphoneos/YourApp.app//YourApp

    What worked for me is removing /$(BUNDLE_EXECUTABLE_FOLDER_PATH) from the TEST_HOST

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search