1

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.

AL.
  • 36,815
  • 10
  • 142
  • 281
user2227745
  • 21
  • 1
  • 3
  • 1
    Hi. Please post relevant code snippets and any other useful data (e.g. logs). :) – AL. Feb 03 '17 at 02:50
  • Are you opening the xcworkspace file with Xcode instead of the xcproject? – Paul Beusterien Feb 03 '17 at 15:00
  • 1
    @AL There are no code snippet as of yet this is just a build issue. The only code of I have but in place is import Firebase. The logs I see for the build issue in Xcode are **Parse Issue: Could not build module FirebaseCore while building module Firebase Analytics in File included from :1: in file included from FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h** this error is followed by **Could not build module FirbaseAnalytics** – user2227745 Feb 07 '17 at 12:57
  • @PaulBeusterien I have been opening the workspace file. But only adding files to the project. – user2227745 Feb 07 '17 at 12:58

2 Answers2

1

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.

Cœur
  • 37,241
  • 25
  • 195
  • 267
H4Hugo
  • 2,570
  • 3
  • 16
  • 32
  • minimum required version is now CocoaPods 1.4.0. See https://github.com/firebase/firebase-ios-sdk – Cœur Dec 16 '17 at 13:35
0

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

Md. Fazlul Hoque
  • 15,806
  • 5
  • 12
  • 32
Khaliq Izrail
  • 89
  • 2
  • 10