Xcode error: Missing required module 'Firebase'
Asked Answered
A

4

43

The problem:

I have a dynamic framework, which uses Firebase added by cocoapods. And I also have the App, which uses this dynamic framework. But when I try to build the project I got error Missing required module Firebase.

I tried the following:

  • remove derived data + clean
  • re-install pods
  • add 'Import paths' to the build settings (in this case I got error 'Library not loaded' in runtime)

My podfile:

target 'Project' do    
  ...
end
target 'Framework' do    
  pod 'Firebase/Core'
  pod 'Firebase/Auth'
end

The Framework is added to Embedded binaries and Linked Frameworks and Libraries.

Asthenopia answered 10/12, 2018 at 6:50 Comment(2)
Do you see the framework flag in 'Other Linker Flags'?Grunion
@MarmikShah No, I don'tAsthenopia
S
73

For anyone still having this issue, doing this solved it for me. Add this to your test target build settings.

HEADER_SEARCH_PATHS = "${SRCROOT}/Pods/Firebase/CoreOnly/Sources"

Full discussion can be found on firebase GitHub issues.

you can find HEADER_SEARCH_PATHS in Test Target > Build Settings > Search Paths > Header Search paths.

Just incase you cant find HEADER_SEARCH_PATHS in Build Settings, click the ALL button to show all settings.

Solemnity answered 28/4, 2020 at 11:2 Comment(0)
D
37

Add the following to your test target:

HEADER_SEARCH_PATHS = "${PODS_ROOT}/Firebase/CoreOnly/Sources"

That’s in test target > Build Settings > Header Search Paths.

Decrypt answered 21/1, 2019 at 11:32 Comment(0)
C
5

After adding test target, running:

pod install

and add to:

HEADER_SEARCH_PATHS = $(inherited)

fixed for me.

On Framework Search Path pod put all pod projects path automatically.

Of course, to podfile added this after last pod name:

target 'TestTargetName' do
  inherit! :search_paths
end
Chambermaid answered 23/1, 2020 at 9:10 Comment(1)
I needed to add "${SRCROOT}/Pods/Firebase/CoreOnly/Sources" to this solution.Frost
S
1

Nothing did help to me until

target 'TestTargetName' do
  
    pod 'Firebase/Storage'
  
end

I'm not sure what firebase does so I can't run tests (tests do not depend on firebase at all)

Sonja answered 21/4, 2021 at 8:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.