Unit tests for Swift projects that import Firebase fail to build
Details in http://stackoverflow.com/questions/38216090/xcode-unit-testing-with-cocoapods/39602648
Reproducible test case at https://github.com/marcelofabri/BrokenFirebase
It looks like ${PODS_ROOT}/Firebase/Core/Sources is appropriately being added to the regular target's .xcconfig file but not the test .xcconfig file. Trying to figure out if this is on our side, or if I can find issue in Cocoapods.
In the meantime for people seeing this issue, adding ${PODS_ROOT}/Firebase/Core/Sources to the HEADER_SEARCH_PATHS after $(inherited) in your Pods-<ProjectName>Tests.debug.xcconfig should fix the build.
Still investigating.
"${PODS_ROOT}/Firebase/Core/Sources" to your Tests target only under Build Settings -> Header Search PathsThe root cause has to do with our internal build system and I'll track the progress at #58.
As per #58 this issue is resolved with CocoaPods 1.4.0
I've had this problem and I found by running _sudo gem update_ in terminal and then adding _pod 'Firebase'_ to the podfile, I was bale to solve it. Hope this turns out the same for you. Good luck!
Actually never mind the problem is back. Are you using Xcode 10?
I have the same error.
I fixed using $(SRCROOT)/Pods/Firebase/Core/Sources in the Header Search Path for my test target only.
How do I do that?
Some possible workarounds:
If someone shares a reproducible example, I'll take a deeper look.
@paulb777 Thanks for the reply.
For some strange reason, using ${PODS_ROOT} does not resolve correctly.
Sorry I鈥檓 really new to this. Could you tell me like a step by step like what things to press and where to type in Xcode for the ${PODS_ROOT} things? Your help is greatly appreciated.
It's one of the fields in the Build Settings tab of your xcodeproj file.
I solved this problem by adding the following settings to the Header Search Path in the test target.

This is still happening. Confirmed with CocoaPods 1.6.0. @shtnkgm workaround works. There's a way to set up this search path from the Podfile?
Being the top search result probably makes this the best place to ask, eventhough the issue is closed.
@ryanwilson Issue is still happening. Should we stick to the mentioned workaround?
Same here, issue still happening on CocoaPods 1.6.0.
Confirming that @shtnkgm workaround was good for me!
yes we should reopen this issue, still happens
I have

But still I have this issue Missing required module 'Firebase'

I had to use this temporary solution https://stackoverflow.com/a/40524145/7767664 to fix it
This is still an issue using cocoapods 1.6.2. The above workarounds have not helped me, it complains about the following Undefined Symbols:

@echamussy this is a separate issue from the parent issue. The above issue is resolved with just fixing the header search paths; yours is one where you're missing symbols at link time. Please file a new issue and share a project that reproduces your error.
+1
@morganchen12 For me it is still not clear how this could be fixed. Could you please explain how header search paths should be fixed.
I tried several suggestion, but they were not helping.
@ramunasjurgilas See https://github.com/firebase/firebase-ios-sdk/issues/16#issuecomment-449701843
I just wanna figure out whose bug it is, firebase? or cocoapods?
I tested the reproducible test case above with Xcode 10.1 and CocoaPods 1.7.5 and it successfully finds the Firebase module.
We'll need an example that is reproducible with current tools to make more progress.
Wait so was there a fix? Still happening for me as well.
@ikeller96 There was a CocoaPods fix in 1.6.0. If it's still happening for you, we need a repro to investigate.
@paulb777 I am on CocoaPods version 1.5.3. I'll try updating and see if that works.
So @paulb777 I have CocoaPods v 1.6.0 now but I am getting the same error in a different test.
Have you tried deleting derived data since installing a new version of CocoaPods?
@morganchen12 Yes. Just tried that and I'm still getting the same error.
Can you share your project?
@morganchen12 This problem was occurring for me during an attempt at a swift 5 migration. Our company has decided to rebuild the app and therefore there will be no more releases so we are no longer going to try the swift 5 migration. Thank you for your help though.
Reposting an above reply from anonym24 for the weary traveler:
"I had to use this temporary solution https://stackoverflow.com/a/40524145/7767664 to fix it"
Most helpful comment
This is still happening. Confirmed with CocoaPods
1.6.0. @shtnkgm workaround works. There's a way to set up this search path from thePodfile?