2

I'm trying to import Firebase after installing Cocoapods via terminal but i'm getting the following error message:

Could not build Objective-C module 'Firebase

Can someone help me out with this?

This is my Podfile content:

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

target 'Login_test' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Login_test
    pod 'Firebase/Core'
end
4
  • This is unlikely to be enough detail for anyone to provide a useful answer. Describe what you did and what happened. Commented Feb 11, 2018 at 2:13
  • Try Shift+Option+Command+K to clean the build folder and rebuild again. Additionally, you might want to post your Podfile. Commented Feb 11, 2018 at 4:11
  • Paul Beusterien, See the steps that i've taken below: 1. I've installed Firebase with Cocoapods using the terminal according to the following installation video: youtube.com/watch?v=iEAjvNRdZa0&spfreload=10 2. I tried to import the Module in Xcode and it gave me this error. Also when i try to build the app with the simulator i'm getting the error that it can't find FirebaseAnalytics. Commented Feb 13, 2018 at 8:52
  • check this answer. i fixed my issue with those steps. stackoverflow.com/a/69503768/9437421 Commented Oct 9, 2021 at 5:18

3 Answers 3

3

Assuming that you have installed FireBase properly via CocoaPods. Try the following steps

Step 1 - Close Xcode

Step 2 - Clear your derived data. You can find your derived data in here

~/Library/Developer/Xcode/DerivedData

Step 3 - Open your .xcworkspace

Step 4 - Clean your project (⌘+Shift+K)

Step 5 - Build your project (⌘+B)

Hope this helps.

Sign up to request clarification or add additional context in comments.

5 Comments

This did not help. I get the same error message. Error message; Could not build Objective-C module 'Firebase. Also when i try to build the app i get the following error message: Linker command failed with exit code 1 (use -v to see invocation). When i reveal it in Log i see the following: Framework not found Firebaseanalytics.
Can you install firebase again with cocoapods and try again? It will be great if you show us your Podfile contents.
Hi Rizwan, This is my Podfile content: # Uncomment the next line to define a global platform for your project platform :ios, '9.0' target 'Login_test' do # Comment the next line if you're not using Swift and don't want to use dynamic frameworks use_frameworks! # Pods for Login_test pod 'Firebase/Core' end
Do you also have the correct info instructions for installing cocoapods and Firebase? See my Podfile contents in my question at the top!
@ChikeKotzebue Try installing the Firebase pod with updated cocoapods (v1.5.0 or higher). Cocoapods team has released a new version of cocoapods now.
3

for beginners:

make sure you read the message after installing the Pod, you need to close the xcode project and use the .xcworkspace for this project from now on.

1 Comment

:) awsome! it was a small detail missing from the other solutions I was finding online as well, so odd, it was right in front of us 😊
3

For me the issue was simple. I have a new m1 mac and it has trouble loading cocoa pods sometimes. Simply click your pods project(blue pods)->Click all & build settings ->Excluded architectures -> add "arm64" to both debug and release -> set any SDK on left side -> do this on your main project folder too -> build it your good to go

See Example

Comments

Your Answer

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.