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
This solved my issue
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 theTEST_HOST