user2227745
user2227745

Reputation: 21

Could not build module Firebase

I have been trying to wire up Firebase analytics into a Objective C/Swift project. I have followed the instructions properly. My search paths are set. My linker flags is set to -ObjC. I can get the project to compile properly. As soon a I @import Firebase and build, I get an error that says cannot build Firebase module. When I look into the logs I see there is a parse issue building Firebase analytics and Firebase Core. I have wired this into three other projects fine not using cocoa pods. Please advise.

Upvotes: 1

Views: 5934

Answers (2)

Khaliq Izrail
Khaliq Izrail

Reputation: 95

All you need to do is to install cocoapods. I am using M1 macbook with xcode 12.4. i was facing the same issue.

This worked for me:

  • rm -rf project.xcworkspace
  • rm -rf ~/Library/Developer/Xcode/DerivedData
  • rm -rf Podfile.lock
  • sudo gem install cocoapods
  • pod install

/!\ Open project.xcworkspace instead of your old file

Upvotes: 0

H4Hugo
H4Hugo

Reputation: 2650

I have faced this issue and tried everything possible:

- (Checked that I was actually using .xcworkspace instead of .xcproj)
- Deleted Derived Data
- Cleaned Pods folder, deleted Podfile.lock, pod deintegrate and pod install / update again
- Deleted cached file everywhere on my mac (including hidden folders in Library/Caches/Cocoapods), /var/folders etc.
- Deleted the project, uninstalled Xcode, reinstalled, cloned again etc.
- Check all Build Settings in Xcode, desperately tried all options

Nothing worked.

The only solution (and the correct one) was to run a sudo gem install cocoapods to go from 1.2.0 to 1.2.1.

Indeed, you can see that in the changelog for 1.2.1 there is this pull request that fixes import issues with vendor frameworks

TL;DR If you are running cocoapods 1.2.0, you will want to run sudo gem install cocoapodsand make sure you are at least running 1.2.1.

You can check your version by typing pod --version anywhere on your terminal.

Upvotes: 1

Related Questions