iOS Swift - No module such as Firebase - ios

This is my podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
target 'Grabit' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Grabit
pod 'Firebase','>= 2.5.0'
I tried:
Correct podfile like above.
Open project by terminal
Clean and rebuild project.
I tried it many times but I still get the error:
no module such as Firebase
These are my version of Firebase:
Installing Firebase 3.5.2 (was 3.5.2)
Using FirebaseAnalytics (3.3.1)
Using FirebaseInstanceID (1.0.8)
Any help is appreciated.

Things to check when getting this message:
no module such as Firebase
Does your Podfile file have use frameworks!? should look something like
use_frameworks!
target 'Project' do
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Core'
pod 'Firebase/Database'
end
target 'Project' do
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Core'
pod 'Firebase/Database'
end
Notice that if you want the latest version of a pod, you don't need to specify the version
Do you open your project with MyProject.xcworkspace (white icon) file and not with MyProject.xcodeproj (blue icon)?
Close Xcode and run pod install or pod update. Then open the MyProject.xcworkspace and build the project

Try Cleaning up the Project.
So far this works for me. Also I notice you're missing the "end"
target 'yourProjectname' do
platform :ios, '9.3'
use_frameworks!
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
end

This is working perfectly for me:
use_frameworks!
target 'Project' do
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Core'
pod 'Firebase/Database'
end
You don't need to set the version, by using just the name, you'll always get the latest version.
In Termin do pod install, then pod update.
Then completely clean your project with [CMD]+[ALT]+[SHIFT]+[K].
Then clean with [CMD]+[SHIFT]+[K].
Then close Xcode, start MyProject.xcworkspace (white icon) and build.

Delete Derived Data,Try Cleaning the Project and then Build, it will work then.

Related

Firestore build error in abseil with Swift and Cocoapods

I have a swift project that is using Firestore. There is a build issue when compiling the abseil pod that is included by Firestore. When I attempt to build the project, I intermittently get this error: absl/base/internal/inline_variable.h file not found.
I am using Xcode 11.4, Cocoapods 1.9.1, and Swift 5.
I have tried clearing derived data, updating pods, and deintegrating pods. The one workaround that seems to work is the following, but when I switch devices for a build, the error occurs again.
1. Comment out Firestore in the Podfile.
2. Run bundle exec pod install
3. Open Xcode and build.
4. Uncomment Firestore in the Podfile.
5. Run bundle exec pod install
6. Open Xcode and build.
These steps will work temporarily. Does anyone know of a way to get past this issue?
Here is the Podfile that I am using:
source 'git#git.myresearchapp.com:MyCompany/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.0'
target 'MyApp' do
use_frameworks!
pod 'RNCryptor'
pod 'KeychainSwift'
pod 'Sentry', git: 'https://github.com/getsentry/sentry-cocoa.git', tag: '3.11.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'UICircularProgressRing', '~>4.1.0'
pod 'IHKeyboardAvoiding', git: 'git#git.myresearchapp.com:MyCompany/IHKeyboardAvoiding.git', branch: 'master'
pod 'GTProgressBar'
pod 'AWSSNS'
pod 'AWSCognito'
pod 'AWSS3'
pod 'Validator', git: 'https://github.com/jlowe234/validator'
pod 'SwiftyOnboard', git: 'git#git.myresearchapp.com:MyCompany/SwiftyOnboard.git', branch: 'master'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Storage'
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'MyAppUITests' do
inherit! :search_paths
# Pods for testing
end
end
I solved this problem by updating to the latest version of Sentry. Apparently there is a build conflict between Firestore and version 3.11.0 of Sentry.
The fix is to change the Podfile entry for Sentry to the following:
pod 'Sentry'
After spending hours searching and trying to solve this issue, the only solution was to add a pre-compiled Firestore SDK.
add this line to the PodFile
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '7.3.0'
refer to firestore-ios-sdk-frameworks for more info

'FirebaseCore/FirebaseCore.h' file not found in swift5 on ios

I have a problem using FireBase. I had no problem with the build, but there was an error with the Firebase in iOS10.3 and I tried the suggested solution.
rm -rf ~/Library/Developer/Xcode/DerivedData/
And then I erased the cache and rebuilt it. However, the error has been changed.
'FirebaseCore/FirebaseCore.h' file not found Could not build // firebase.h
Objective-C module 'Firebase' // Appdelegate.swift
my podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'
target 'testtest' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for DeleteMe
pod 'SwiftSVG', '~> 2.0'
pod 'Toaster'
pod 'BigInt', '~> 4.0'
pod 'CryptoSwift'
pod 'RealmSwift'
pod 'web3.swift.pod', '~> 2.2.0'
pod 'Firebase'
pod 'Firebase/Messaging'
pod 'Firebase/Auth'
pod 'Firebase/Core'
end
I erased Pod and tried to rebuild it, but the error was the same.
$ pod deintegrate
$ pod clean
$ pod install
How can you solve this problem?
Xcode : Version 11.0
realDevice : iphone5 10.3
I just built my other test iPhone 6 version 12.4, but there was no error. There seems to be a problem in version 10.3.

Cannot find module error when archiving iOS project using CocoaPods

I get an error "cannot find module SwiftMessages" when archiving an iOS project. I'm using CocoaPods, Xcode V10.2, and iOS V10.1. Here's my pod file:
# Uncomment the next line to define a global platform for your project
platform :ios, '10.1'
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Minuteapp
pod 'FacebookCore'
pod 'FacebookLogin'
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod 'FBSDKLoginKit'
pod 'FacebookShare'
pod 'Firebase/Database'
pod 'Firebase/Core'
pod 'Firebase'
pod 'FolioReaderKit'
pod 'SwiftyStoreKit'
pod 'SwiftMessages' , '7.0.0'
pod 'GoogleSignIn'
pod 'Promises'
pod 'Firebase/Auth'
pod 'Firebase/Analytics'
pod 'Flurry-iOS-SDK/FlurrySDK' #Analytics Pod
pod 'Flurry-iOS-SDK/FlurryAds' #Advertising Pod (requires Analytics)
pod 'Flurry-iOS-SDK/FlurryMessaging'
pod 'STPopup'
pod 'SendGrid-Swift'
pod 'DeviceKit'
end
Try deleting the DerivedData folder:
~/Library/Developer/Xcode/DerivedData/
There is a folder inside named ModuleCache that caches module versions. Removing it will make all the modules be recompiled, probably solving your issue.

Google-Mobile-Ads-SDK - CocoaPods won't download version 7.9.1

I've got a problem with CocoaPods and the dependency of 'Google-Mobile-Ads-SDK'.
If I run
'pod install'
with the entry
pod 'Google-Mobile-Ads-SDK'
it doesn't download the framework.
If I change it to the following:
pod 'Google-Mobile-Ads-SDK', '7.9.0'
it works.
All our computers got the same problem.
It seems that the version '7.9.1' has a bug.
EDIT:
Here is my Podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
# here we can define globals pods that are used by all targets
def sharedPods
pod 'Mapbox-iOS-SDK'
pod 'CorePlot'
pod 'GoogleAnalytics'
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod 'SDCAlertView'
pod 'Google-Mobile-Ads-SDK'
end
target 'serverapp' do
sharedPods
end
EDIT_2:

Cocoa Pods not updating inside of app

I have been assigned at work to update an app that hasn't been touched in a year and a half. The cocoa pods version is 0.22.
I am trying to update it to 0.35. I've run 'sudo gem update' and have .35, but when I run 'pod install' it just installs the old versions of all of the pods (i.e. AFNetworking 1.1.0).
Thanks
platform :ios, '6.0'
pod 'Facebook-iOS-SDK'
pod 'OpenCV'
pod 'RestKit'
pod 'QuickDialog'
pod 'ReactiveCocoa'
pod 'SVProgressHUD'
pod 'Mixpanel'
pod 'GVUserDefaults'
pod 'TTTAttributedLabel'
pod 'uservoice-iphone-sdk'
target :ShoeboxTests, :exclusive => true do
pod 'Kiwi', :head
end
I'm new to using cocoa pods so I'm not sure what to do with this file.
Your podfile specifies that you're targeting iOS 6, so it is possible that cocoapods is only giving you the highest version known to support iOS 6.
Try removing that line entirely, or changing it to:
platform :ios, '8.1'

Resources