FirebaseCore.h file not generating in project using CocoaPods - swift

I recently installed CocoaPods and Firebase into my project. I've been attempting to build but am getting the following errors:
'FirebaseCore/FirebaseCore.h' file not found
Could not build Objective-C module 'Firebase'
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:
Xcode 11.3.1
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

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.

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'

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

Related

Xcode 12, iOS 14, Pods

After updating the iPhone to ios 14, xcode 11.5 stopped launching projects on the iPhone, I decided to upgrade xcode to version 12 and got a huge number of errors related to Pods for 60 of them ... Basically, everything is related to the fact that quotes cannot be used in Pods, and need to use <> to connect libraries. When I correct it with <>, I get errors that I need to use "", but this is all warning, namely error due to the fact that xCode stopped seeing one library. On the screen all the info.
Thank you in advance for your help)
How to fix it?
I had a similar issue and I fixed by changing the deployment target of all Pods. Most Pods were targeting iOS 8.0, which is no longer supported by Xcode 12.
Make Sure You have Same Version for your deployment target and podfile platform
Don't open your Project in XCode 12 after XCode Update
Open Your Project Podfile through terminal
Just remove all your lib and do pod install (Also remove that extra codein podfile if you have written anything regarding architecture of 86 or 64 which we have write for remove warnings)
Clear derive data by path without opening XCode (~/Library/Developer/Xcode/DerivedData)
After Removed all lib all other lib again and do pod install
Open Your Project and set Build System to New Build System (Default) in Shared Workspace Settings and Use Shared Setting in Build System in Pre-User WorkSpace Settings (You can found this settings while XCode Selected go to file menu and click on WorkSpace Settings)
Then Do Clean and build then run it you will not found things regarding module not found you will face some syntax updates or any lib updates fix those and go for run
Try to install pod again, remove all pod and install again.
pod deintegrate
pod install
or
sudo rm -fr ~/Library/Caches/CocoaPods/
pod install
clear DerivedData and run again.

Installing Package with CocoaPods

I'm trying to install the Charts package to use with CocoaPods and it keeps saying "No such module 'Charts'".
If I added the pod 'Charts' in the podfile, and did a pod install and the files are there in Xcode, how come it still gives me an error when I try to import Charts?
Do I still need to do the steps below? Or does CocoaPods do it for me?
Drag the Charts.xcodeproj to your project
Go to your target's settings, hit the "+" under the "Embedded Binaries" section, and select the Charts.framework
My pods file looks like this now:
You just have to hit Command-b to build, then the error will go away. The other solution is to hit Product > Build.
I had a similar problem when I was developing an app for an older platform. The CocoaPod I sourced supported Swift 4 but I was developing for Swift 3. When I sourced the last Swift 3 version of the pod, the "No such module" error was no longer there. Try the following line in your Podfile:
pod 'Charts', '3.0.3'
instead of the latest version.
try installing it manually moving the complete charts folder to your project, or downloading using carthage, it's way more cleaner using carthage than cocoapods because it doesn't create you a .xcworkspace like cocoapods.

Cocoapods: Cannot load module 'Alamofire' as 'Alamofire'

Update: I solved the question. Please see my answer below (underneath the question and comments).
This question was marked as a duplicate, but it's different because it is a brand new error that I couldn't find through any searches.
I tried installing Alamofire into my XCode project.
As per their their tutorial, I installed cocoapods onto my system.
I then navigated to the folder of my existing xcode project in the terminal, and did:
pod init
I then edited the new pod file and added:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target 'RainyShinyCloudy' do
pod 'Alamofire', '~> 4.4'
end
Finally, I executed the command:
pod install
My terminal told me the install was successful.
But when I opened the .xcworkspace, made a new swift class and tried to import Alamofire, I got this error:
One possible reason could be that I had tried to install an earlier version of alamofire earlier, deleted it and then installed this.
But I really don't know how that could have mattered.
Thanks for any help you guys can give me.
Actually it failed because you were trying to import AlamoFire and not Alamofire. Imports are case sensitive.
Update: I posted an answer earlier that was wrong.
But now I actually figured it out.
I made a new project, went to the settings menu by clicking on the name of my app in the project explorer.
Then I went to Linked frameworks and libraries which is at the very bottom of the General tab.
I pressed that little + icon, selected Alamofire.framework. and set the status to required
Following this, cleaning and rebuilding the project made the error go away.

Swift: How to integrate a library?

I like to integrate a zip library in my macOS application.
I created a file named Podfile in my project folder (next to .xcodeproj file).
It contains following lines (as given here - on the bottom of the page):
source 'https://github.com/CocoaPods/Specs.git'
pod 'Zip', '~> 0.4'
If I run $ pod install on the terminal, I am receiving this error:
Analyzing dependencies
[!] The dependency `Zip (~> 0.4)` is not used in any concrete target.
EDIT:
I tried it now with the pod init template, but got an error. So I raised a new question.
It's a very simple question, and it does mean that you didn't give your research on what you are searching for. Please do your research, and then post a question here if there is any problem. Please give respect to people's time.
GitHub repo SSZipArchive
CocoaPods
pod install SSZipArchive
Carthage
github "ZipArchive/ZipArchive"

Error when using Realm with Xcode 6.3.1

Today i decided to give a go to Realm for a project, but, when adding it via cococa pods, it just keeps yelling me he can't find Realm.Private on the ListBase class.
tried to clean, tried to reimport, closed & reopened Xcode....
content of my cocoapods file:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'RealmSwift'
thanks.
There was an issue on Realm's GitHub repository about that.
Realm Swift's podspec makes use of some brand new CocoaPods features, so you will need to update CocoaPods to at least 0.37.1.
Cleaning the cache and the existing installation and re-installing has proven to be helpful in that case:
rm -r Pods/Realm
rm -r ~/Library/Caches/CocoaPods/Pods/Released/Realm
pod install