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
aek8
  • 319
  • 1
  • 8
  • 22
Chike Kotzebue
  • 33
  • 1
  • 1
  • 4
  • This is unlikely to be enough detail for anyone to provide a useful answer. Describe what you did and what happened. – Paul Beusterien Feb 11 '18 at 02:13
  • Try Shift+Option+Command+K to clean the build folder and rebuild again. Additionally, you might want to post your Podfile. – Adrian Feb 11 '18 at 04: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: https://www.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. – Chike Kotzebue Feb 13 '18 at 08:52
  • check this answer. i fixed my issue with those steps. https://stackoverflow.com/a/69503768/9437421 – Khaliq Izrail Oct 09 '21 at 05:18

3 Answers3

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.

Rizwan Ahmed
  • 919
  • 13
  • 19
  • 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. – Chike Kotzebue Feb 12 '18 at 01:16
  • Can you install firebase again with cocoapods and try again? It will be great if you show us your Podfile contents. – Rizwan Ahmed Feb 12 '18 at 03:00
  • 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 – Chike Kotzebue Feb 12 '18 at 16:10
  • Do you also have the correct info instructions for installing cocoapods and Firebase? See my Podfile contents in my question at the top! – Chike Kotzebue Feb 12 '18 at 16:17
  • @ChikeKotzebue Try installing the Firebase pod with updated cocoapods (v1.5.0 or higher). Cocoapods team has released a new version of cocoapods now. – Rizwan Ahmed Jul 06 '18 at 06:51
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.

Kostas Kapetanakis
  • 511
  • 1
  • 5
  • 10
2

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

Zach Gonzalez
  • 792
  • 7
  • 16