Error: Could not build Objective-C module 'Firebase'
Solution 1
There is only one way to solve this issue.
- Quit Xcode.
- Delete project's temp files located at
~/Library/Developer/Xcode/DerivedData
- Delete
ProjectName.xcworkspace
- Delete
Podfile.lock
file andPods
folder - Run
pod install
. - Open the newly created
ProjectName.xcworkspace
file and build.
Solution 2
Build (⌘ + B) worked for me.
Solution 3
I am using Swift 4 and Xcode 9. All I have to do is selecting FirebaseCore Scheme.
On Xcode:
Product->Scheme->FirebaseCore.
If you don't have FirebaseCore go to Manage Schemes
and select it. Then try again.
Solution 4
This may fix your problem:
Quit the Xcode. (Don't just close the Xcode window, right click and Quit it explicitly).
Go to
~/Library/Developer/Xcode/DerivedData
and delete the project folder. (Simply delete all the folders).Clean and Build the project.
If still error exist:
Do steps 1 and 2 and follow this steps:
Change scheme to Firebase and Build (Command + B).
Change back to your app scheme and Run again.
Solution 5
I opened the project with .xcodeproj and I installed Firebase with cocoapods. I got the same error. But I just close the project and open it with .xcworkspace.
The alert has gone. Firebase was the first library on my project. So I kept using .xcodeproj file.
sebas.varela
Updated on January 27, 2022Comments
-
sebas.varela over 2 years
When I compile the application I get an error equal to this:
Could not build Objective-C module 'Firebase'
This error appear in
import Firebase
of my file swift. -
Cons Bulaquena about 6 yearsIf I delete ProjectName.xcworkspace, does it delete the previous code there?
-
Dimitris Bouzikas about 6 years@ConsBulaquena Actually, you have to delete the
xcworkspace
, it doesn't include the code you wrote but is automatically generated by Pod, don't worry about it. -
aremvee almost 6 yearsworked for me after I applied the first answer. Also had to change the FIRApp.configure() to FirebaseApp.configure()
-
Jonas almost 6 yearsI don't have a Xcode folder I
~/Library/Developer
-
Dimitris Bouzikas almost 6 years@Jonas weird, open Xcode, go to Preferences->Locations and share what you see. Check mine: ibb.co/dUvgk8
-
Jonas almost 6 years@DimitrisBouzikas thanks a lot! It was under
~/User/ME/Library/...
and there the Library folder was hidden. (Made it visible with Shift+cmd+(dot)) -
nommer almost 6 yearsworked for me without having to apply Dimitris Bouzikas answer, and i was adding firebase to an existing project for those doing the same
-
Kaushal Topinkatti almost 6 yearsFantastic my friend you helped me, Thank You. Was searching for this from past 4 days. Thank You. Guys its works!!!
-
Mario Rojas over 5 yearsI tried Dimitri's solution but it didnt work, ended up missing necessary files, this solution did fix the problem
-
Lucy over 5 yearsThis worked for me too! (I also restarted Xcode using 'open myproject.xcworkspace after installing Pods in case that matters)
-
Dimitris Bouzikas over 5 years@MarioRojas Can you determine what are the necessary files? Study a bit how Pod works.
-
Samarth Kejriwal over 5 yearsThe above steps didnt solve my issue, please help me.
-
Admin about 5 yearssolved my problem. Note that this will delete your existing build schemes.
-
Abhijith about 5 yearsPlease try other answers. Your case can be different.
-
Brent almost 5 yearsThis was the only answer that worked for me using Xcode 9.4 on Ionic 3 app.
-
Matthew Anderson almost 5 yearsWhen I switch my scheme back to my app scheme, this no longer works. Could someone please explain?
-
Ayrad over 4 yearsthe first two steps worked for me. I didn't have to delete the workspace file, I just had to open it instead of the project file after quitting xcode and deleting derived data
-
Julian Wagner over 4 yearsfor future readers, there is a library folder of the computer and one of the user, most of the time it is in the users one
-
Julian Wagner over 4 yearsfor those who don't know how to run pod install: stackoverflow.com/questions/30418062/…
-
Ruairí Oliver almost 4 yearsI only needed step 4 and 5
-
shinriyo almost 4 yearsProduct => Edit Scheme... Short cut is command + <
-
ArdenDev over 3 yearsThank YOU @marceh , this helped me. After trying the steps above it didn't work.
-
Milovan Tomašević over 3 yearsThanks a lot, you saved my time!
xCode v12
-
Roman Soviak over 3 yearsstackoverflow.com/a/28433526/7856586 if you cannot find DerivedData folder
-
cseh_17 over 2 yearsThis is the only solution that worked for me. Thanks!
-
Israr Ahmad over 2 yearstried many other solutions. But this one worked. Really helped.
-
Mamedoff over 2 yearsWorked for me on my M1 Pro device. Thank you.
-
Genki about 2 yearsI'd like to vote this as one of the funniest answers.
-
Qadir Hussain about 2 yearsthis worked for me too. I disabled "Find implicit Dependencies" and build was working fine too, I recently got this issue after updating the xcode. Error gone by enabling this option again on the new updated xCode.