0

I recently installed CocoaPods and Firebase into my project. I've been attempting to build but am getting the following errors:

  1. 'FirebaseCore/FirebaseCore.h' file not found

  2. Could not build Objective-C module 'Firebase'

  3. Command PhaseScriptExecution failed with a nonzero exit code

I checked my folders and the FirebaseCore.h file definitely does NOT exist. I've reinstalled CocoaPods, modified the Podfile and did a 'pod update' and 'pod install' several times.

I've reviewed several of the questions and solutions listed on stack overflow but none of them have worked.

Here are my specs:

  1. Xcode 11.3.1

  2. Swift 5

My Podfile looks like this:

# platform :ios, '9.0'
target 'project' do
 use_frameworks!
 # Pods for Project
 pod 'MessageKit', '~> 3.0.0-swift5'
 pod 'MessageInputBar'
 # Add the Firebase pod for Google Analytics
 pod 'Firebase/Analytics'
 # Add the pods for any other Firebase products you want to use in your app
 # For example, to use Firebase Authentication and Cloud Firestore
 pod 'Firebase/Auth'
 pod 'Firebase/Firestore'
 end
asked Jan 14, 2020 at 7:04
1
  • Note that you don't need Firebase/Core any longer as it's included in Analytics. Commented Jan 14, 2020 at 17:32

3 Answers 3

1

That's the error you'll get when opening the project using the .xcodeproj file.

You need to use the .xcworkspace file to open the project.

That file is generated when installing the pods using cocoapods.

Other things to try

  • Quit XCode. Go into terminal and do this sudo gem install cocoapods. Then use the cocoapods.app to update the project with your pod file. Then clean and rebuild the project.

  • In your project, select the project name in the left column (where the project files are). Then in Targets, ensure the Team popup is selected to your team name, not 'None' and that your Signing Certificate is correct.

  • This one is extreme but I have seen it correct some build issues. Deleting the login keychain (using the keychain.app). This will also delete all of your stored passwords so keep that in mind.

answered Jan 14, 2020 at 17:34
Sign up to request clarification or add additional context in comments.

6 Comments

I am using my .xcworkspace file. I haven't opened my .xcodeproj file since installing cocoapods
Thank you for responding @Jay, any other recommendations
@techgirl I ran though the Firebase Guide Installing for iOS just now and it worked perfectly, so that tells me either a step was missed or there's something else in your project causing the issue. I see in your question the podfile doesn't match that guide so perhaps something was overlooked. I would suggest removing your pods using the cocoapods app. Adjusting you podfile to match exactly and then installing again. From there, ensure you've added the .plist file, and that your developer credentials are up-to-date and selected in the app.
Thanks Jay. I've gone through the installation guide several times so I believe you're right that something else must be wrong. I'm going to go through the steps you recommended here...stay tuned.
I've removed cocoapods and went back through the firebase steps but am still getting the same error as above.
|
0

Even I had same issue when upgrading to Xcode 11.2.1. Errors were resolved after using Firebase 6.13.0. Please make changes to your Podfile as below,

 pod 'Firebase', '=6.13.0'
 pod 'Firebase/Core'
 pod 'Firebase/Analytics'
answered Jan 14, 2020 at 9:43

3 Comments

thanks for responding. I made the recommended changes but am still getting the two errors. Any other suggestions? Fingers crossed.
Can you please paste here entire Podfile and error you are getting.
I've updated the question with the entire pod file # Uncomment the next line to define a global platform for your project platform :ios, '9.3' target 'xxxx' do # Comment the next line if you don't want to use dynamic frameworks use_frameworks! # Pods for xxxxxx pod 'MessageKit', '~> 3.0.0-swift5' pod 'MessageInputBar' pod 'Firebase', '=6.13.0' pod 'Firebase/Core' pod 'Firebase/Analytics' end
0
Somehow my base project had other issues that were generating this error that I was never able to uncover. So I did the following:
1. Created a new project and imported old project files.
2. Installed cocoapods on the new project
3. Followed the FireBase instructions referenced in the answer from @Jay
4. Cleaned project and performed a build
5. No more error
answered Jan 15, 2020 at 4:04

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.