4

I'm trying to integrate Firebase into my app, but as soon as I'm building it after I thought I finished my install I get:

Redefinition of module 'Firebase'

as well as

Could not build Objective-C module 'SwiftOverlayShims'

which I have no idea what that means but I'm assuming its a result of the first.

My podfile looks like this:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'app' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

pod 'Firebase/Auth'

  # Pods for app

end

So I don't think theres anything conflicting there. I saw a solution that told me to go into my Header Search Path and see if my project had multiple Firebase directories, but I have no custom paths, so that wasn't it. Any insight?

EDIT: Here is the exact display from my errors enter image description here

Uncommenting the platform line in my podfile and changing it to iOS 10.0 did get rid of the error saying "Could not build Objective-C module 'Firebase'" So we have made some progress.

Here is the path when selecting "previously defined here"

enter image description here

From what I can tell, it is only giving me one location. Selecting the redefinition error just gives me the relative path of module.modulemap , so I am assuming that is referring to the same thing. I am also getting multiple warnings like this


Skipping duplicate build file in Copy Files build phase: /Users/me/Library/Developer/Xcode/DerivedData/app-elgcucdextsnzqbtlznbqeulbfks/SourcePackages/artifacts/Firebase/FirebaseAnalytics.xcframework/ios-arm64_i386_x86_64-simulator/FirebaseAnalytics.framework

as well as a couple other frameworks in the ios-arm64_i386_x86_64-simulator directory, so maybe that has something to do with it.

Jacob F
  • 135
  • 3
  • 13
  • So, You have already existing project, or it fails when You just create a new project, add 'Firebase/Auth' and run pod install? – Whirlwind Feb 28 '22 at 18:43
  • It was an existing project. – Jacob F Feb 28 '22 at 18:45
  • Well, You can try first with `pod deintegrate` and `pod install`. Make some backup. Do this while Xcode is closed completely. Clean derived data, and see if it works. – Whirlwind Feb 28 '22 at 18:54
  • Please remove the answer and describe what errors show up. Likely more context about SwiftOverlayShims is needed. – Paul Beusterien Mar 01 '22 at 01:16
  • @Whirlwind that didn't work unfortunately – Jacob F Mar 01 '22 at 01:51
  • @PaulBeusterien I am getting 3 Errors: 1) Redefinition of module 'Firebase' -- I have it referenced in my code twice, once in AppDelegate, and once in the file I'm trying to use Firebase in. It says it is referenced in the Firebase module as well – Jacob F Mar 01 '22 at 01:53
  • 2) @PaulBeusterien Could not build Objective-C module 'SwiftOverlayShims' -- no idea what this is, all I did was try and install firebase so I don't know what this is even for. in the error it says this is a result of the first -- redefinition of module 'Firebase' – Jacob F Mar 01 '22 at 01:55
  • @PaulBeusterien 3) Could not build Objective-C module 'Firebase' -- assuming this is also a result of the first, from it being redefined – Jacob F Mar 01 '22 at 01:56
  • Does the redefinition error message show where the previous definition was? – Paul Beusterien Mar 01 '22 at 14:23
  • It says it is in module.modulemap which just says module Firebase { export * header "Firebase.h" @PaulBeusterien – Jacob F Mar 01 '22 at 15:02
  • And where is the redefinition? – Paul Beusterien Mar 01 '22 at 18:35
  • It is currently throwing an error on every single .swift file actually. I only have "import Firebase" in AppDelegate and in the file I'm actually trying to use it in. So I'm not sure why I would be getting errors on things that are seemingly irrelevant. @PaulBeusterien – Jacob F Mar 01 '22 at 18:50
  • A redefinition error message should give two locations? Another issue is that Firebase now require iOS 10 so there should be something like `platform :ios, '10.0'` in the Podfile. – Paul Beusterien Mar 01 '22 at 19:17
  • @PaulBeusterien Edited my original question to give some more context. But as far as i can tell it's only giving me one location. – Jacob F Mar 01 '22 at 22:52
  • Sharing a reproducible example in GitHub repo or other place may help others to help you. Otherwise, I suggest learning more about the Xcode error message detail window. – Paul Beusterien Mar 04 '22 at 00:43

1 Answers1

0

so in my situation, this was not a flutter issue see -> Flutter on iOS: redefinition of module 'Firebase'. In my edge case scenario, I was cloning a repo and using the 'open in xcode' feature. Once opening the project , Xcode ran through the various setup and installation process of the project. What happened was it began installing both PODS and SWIFT PACKAGE MANAGER dependencies. For some reason it was installing firebase TWICE. Once in pods and second in package manager.

I recommend you use the package manager.

Julian Silvestri
  • 1,970
  • 1
  • 15
  • 33