pod init to create a Podfilepod 'Firebase' to Podfile under use_frameworks!pod updateimport Firebase to the AppDelegate.swift@testable import <ProjectName> into <ProjectName>Tests.swiftHeader imports from the Firebase pod are added to the testing target, causing
tests to build and run successfully.
A "Missing required module 'Firebase'" build error will appear. The directory
from the Firebase pod is not added to the testing target's
Header Search Paths even though inherit! :search_paths is set.
CocoaPods : 1.2.1
Ruby : ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin16.0]
RubyGems : 2.2.2
Host : Mac OS X 10.12.5 (16F73)
Xcode : 9.0 (9M174d)
Git : git version 2.13.0.rc1.294.g07d810a77f-goog
Ruby lib dir : /Users/wilsonryan/.rbenv/versions/2.1.3/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 92958bc76be648b458ed2cdf50ea7a5185aef134
(This does happen on previous Xcode versions as well).
Executable Path: /Users/wilsonryan/.rbenv/versions/2.1.3/bin/pod
cocoapods-deintegrate : 1.0.1
cocoapods-playgrounds : 1.2.2
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.0.0
cocoapods-trunk : 1.2.0
cocoapods-try : 1.1.0
Example project can be found here.
This is fixable on the user's side by explicitly adding
"${PODS_ROOT}/Firebase/Core/Sources" to the test target's
Header Search Paths, but it shouldn't be necessary. There may be a fix for the
Podspec that can alleviate this issue in which case we're happy to do so!
The current podspec for the Firebase pod can be found here
and the high level structure for all of Firebase is as follows:
FirebaseCore, FirebaseAuth, FirebaseDatabase, and more.Firebase is an umbrella pod that contains multiple subspecs, all parts of Firebase:Core is the default subspec that provides the umbrella header that imports any Firebase SDK that is available to the user.Auth, Database, Messaging, etc.Auth depends on FirebaseAuthDatabase depends on FirebaseDatabaseAt the moment, the spec relies on the user_target_xcconfig flag in the Core
subspec to explicitly add ${PODS_ROOT}/Firebase/Core/Sources to
HEADER_SEARCH_PATHS. This isn't recommended, and the regular
target's case can be solved by explicitly adding
"public_header_files": [ "Core/Sources/Firebase.h" ], to the podspec, removing
preserve_paths and replacing it with module_map as seen below.
{
"dependencies": {
"FirebaseAnalytics": "4.0.2",
"FirebaseCore": "4.0.3"
},
"name": "Core",
"preserve_paths": [
"Core/Sources/module.modulemap"
],
"source_files": [
"Core/Sources/Firebase.h"
],
"user_target_xcconfig": {
"HEADER_SEARCH_PATHS": "$(inherited) ${PODS_ROOT}/Firebase/Core/Sources"
}
},
{
"dependencies": {
"FirebaseAnalytics": "4.0.2",
"FirebaseCore": "4.0.3"
},
"name": "Core",
"module_map": "Core/Sources/module.modulemap",
"public_header_files": [
"Core/Sources/Firebase.h"
],
"source_files": [
"Core/Sources/Firebase.h"
]
},
This is cleaner but unfortunately it doesn't solve the issue of the test target
not working out of the box.
If this is a simple Podspec fix we're happy to make the change, otherwise I
believe this is currently a bug.
I'm still having this issue, I'm on cocoapods 1.3.1, the steps to reproduce this are exactly the same as above. Ended up adding "${PODS_ROOT}" as a recursive header search path in the test target.
@cyupa The fix is in CocoaPods 1.4.0
Upgraded to 1.4.0 Beta 2 and it works. Thanks, @paulb777!
Was using 1.4.0 and just upgraded to 1.5.0 and this seems to be broken again using Xcode 9.3 and the latest version of Firebase.
To be specific, this issue appears to have come back. https://github.com/firebase/firebase-ios-sdk/issues/58
Most helpful comment
Was using 1.4.0 and just upgraded to 1.5.0 and this seems to be broken again using Xcode 9.3 and the latest version of Firebase.
To be specific, this issue appears to have come back. https://github.com/firebase/firebase-ios-sdk/issues/58