Firestore installation using Cocoapods - ios

I'm trying to install firestore in my project.
When I'm trying to install that, Xcode displays:
fatal error: module map file '/Users/account/Documents/myapp/Pods/Headers/Private/openssl_grpc/BoringSSL-GRPC.modulemap' not found
or sometimes another errors....
so I've spend so many of times (almost entire 2 days) to solve this problem, but nothing is actually working :/ (deleting derived data and Pods folder, pod deintegrate, pod install and update or cleaning build (Command-shift-k)).
platform :ios, '13.0'
target 'myapp' do
# Comment the next line if you don't want to use dynamic frameworks
#use_frameworks!
use_modular_headers!
# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
pod 'Firebase/Auth'
pod 'Firebase/DynamicLinks'
pod 'Firebase/Core'
pod 'Firebase/Firestore'
#pod 'FirebaseFirestoreSwift'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-posd
end
this is my Podfile. and whenever I delete pod 'Firebase/Firestore', everything's working whereas Firebase/Firestore is not. (surely to recover normal working state, I comment all of pod repositories, (in terminal) type "pod install" and then uncomment top 4 repositories and pod install....)
I really wanna use Firestore, but I can't.

We can also force CocoaPods to not apply modular headers for the troubling pods... in this case:
pod 'BoringSSL-GRPC', '= 0.0.3', :modular_headers => false
pod 'gRPC-Core', '= 1.21.0', :modular_headers => false

Firestore requires latest CocoaPods. As per Google developer
It should get better with CocoaPods 1.9.0 which is adding the
capability to specify dynamic/static linkage for each pod in the
Podfile.
Please check this link https://github.com/firebase/firebase-ios-sdk/issues/3816

Related

Why am I getting the error 'No such module FirebaseUI' in swift?

Every time I try to build I get the error 'No such module FirebaseUI'
Things I have tried:
Clearing derived data
running 'pod update' to make sure all dependencies are up to date
running my install as arch -x86_64 pod install
making sure I am running the app by opening .xcworkspace as opposed to .xcodeproj
Cleaning my build folder(Command+Shift+K)
Deleting my project and redownloading from Git
Adding the FirebaseUI Framework directly to my project
Changing the Scheme to FirebaseCore allows the project to build but the simulator does not open for testing, nor does it run on a physical device.
Running pod deintegrate && pod install, I noted that this command did mention that FirebaseUI was included and that the version was 11.03
Running xcode in Rosetta
I am running this project on a new MacBook Pro with the M1 chip. Previously, my project ran fine on the older intel chip. My Xcode version is 12.5.1, and my OS is 11.4
Here is my pod file:
# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'
post_install do |pi|
pi.pods_project.targets.each do |t|
t.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
end
end
target 'Pikit' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Fixed Pod configuration
# Pods for Pikit
pod 'Firebase'
pod 'Firebase/Storage'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Functions'
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
pod 'Firebase/DynamicLinks'
pod 'FirebaseUI/Auth'
pod 'FirebaseUI/Email'
pod 'FirebaseUI/Google'
pod 'FirebaseUI/OAuth' # Used for Sign in with Apple, Twitter, etc
# Other Podfiles
pod 'OnboardKit'
# Auto move screen for keyboard
pod 'SDWebImage'
pod 'PureLayout'
pod 'IQKeyboardManagerSwift'
pod 'Google-Mobile-Ads-SDK'
end
Edit
the previously selected answer was working for a while but after changing the version of an unrelated pod the application is showing the same issue.
FirebaseUI version 11 is now broken into submodules so you will need to import individual modules (e.g. import FirebaseAuthUI) rather than previously using just import FirebaseUI. Or instruct your Podfile to use an older version.
From FirebaseUI 11.0.0 release notes:
Breaking change: Broke monolithic FirebaseUI module into separate modules per feature. You'll need to update the imports in your project accordingly.
// FirebaseUI 10.x
import FirebaseUI
// FirebaseUI 11
import FirebaseAuthUI
import FirebaseDatabaseUI
// ...
I recommend you running the pod install command under the x86 architecture because I've seen that running this command native bring some problems, try:
arch -x86_64 pod install
I found a solution but I am going to keep this open as I am not sure it is a permanent solution/ not sure why it worked. This conflicts directly with one of the earlier answers. I removed all FirebaseUI pods besides the base one so that my pods related to fire base include only the following:
pod 'Firebase'
pod 'Firebase/Storage'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Functions'
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
pod 'Firebase/DynamicLinks'
pod 'FirebaseUI'

AppAuth not signed at all when adding firebase to xcode project

I'm trying to add firebase to an existing project but I keep getting errors on building and after a couple of days searching the internet I have not yet fixed the issue :(
I've tried adding --deep to the signing flags, locking and unlocking the keychain, switching to use_modular_headers! in the Podfile.
I don't have a physical device to test on.
My Podfile looks like this:
# Uncomment the next line to define a global platform for your project
#platform :ios, '12.0'
target 'EyeArtifact' do
# Comment the next line if you don't want to use dynamic frameworks
#use_frameworks!
use_modular_headers!
# Pods for EyeArtifact
pod 'Firebase'
pod 'Firebase/Analytics'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Storage'
pod 'FirebaseUI'
pod 'FirebaseUI/Google'
pod 'FirebaseUI/Facebook'
pod 'FirebaseUI/OAuth'
pod 'FirebaseUI/Phone'
pod 'FirebaseFirestoreSwift'
# Facebook pods
pod 'FBSDKCoreKit', :modular_headers => true
pod 'FBSDKLoginKit', :modular_headers => true
end
and my error is:
/Users/jvines/Library/Developer/Xcode/DerivedData/***-bgaqkzrrqevduaadrswisdyouwqv/Build/Products/Debug-iphonesimulator/***.app/Frameworks/AppAuth.framework: replacing existing signature
/Users/jvines/Library/Developer/Xcode/DerivedData/***-bgaqkzrrqevduaadrswisdyouwqv/Build/Products/Debug-iphonesimulator/***.app/Frameworks/AppAuth.framework: code object is not signed at all
In architecture: x86_64
If I switch between use_frameworks! and use_modular_headers! I get another error: BoringSSL-GRPC.modulemap' not found when building
I've tried disabling the signing script when building but then if I run the app I get this error: dyld: Library not loaded: #rpath/AppAuth.framework/AppAuth
The simulator is running iOS 14.2 and I'm using Xcode 12
I also tried a brand new project and adding the frameworks from scratch but I encountered the same errors.
I'm new to iOS development so any help is greatly appreciated!
Thank you :)
Found the answer to my problem here: https://stackoverflow.com/a/62172769/14828440
In short I was missing the bridging header even though I don't have any swift files.

how to fix the warning from installed pods after update Xcode?

I am new in programming, I am sorry if my question seems silly. I am trying to build an iOS app using Firebase.
After updating to Xcode 9.3, there are a lot of warnings show up like the image below:
I suppose this come from the Firebase pods, and maybe the pod hasn't been updated by Firebase. am I right?
so what I have to do? do I have to fix the warning manually or I just have to wait the update from Firebase? and If I still run the program with a lot of warning like that, is the program will run properly ?
here is the pods I use
pod 'SwiftyJSON'
pod 'Firebase/Core'
pod 'Firebase/Firestore'
pod 'Firebase/Storage'
pod 'Firebase/Auth'
pod 'SVProgressHUD', :git => 'https://github.com/SVProgressHUD/SVProgressHUD.git'
pod 'GoogleSignIn'
Warnings are usually just that: warnings. Most likely the code will run just fine and you can just wait for the developers to update their code.
Optionally if you dislike seeing them you can inhibit warnings in your pods within your podfile like this:
platform :ios
# ignore all warnings from all pods
inhibit_all_warnings!
# ignore warnings from a specific pod
pod 'FBSDKCoreKit', :inhibit_warnings => true
You'll have to run a pod install for the change in the project settings to happen.
This will suppress warnings in the pods you pull in and give the developers time to fix the issues.
Source: Ignore Xcode warnings when using Cocoapods

Many build errors after pod update

I have many pods installed in my project. Everything worked fine since my last pod update. After last pod update, I have 28 build errors starting with "Could not build module xxx".
Here is my podfile:
target 'projectXXX' do
use_frameworks!
pod 'Firebase'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
pod 'Firebase/Messaging'
pod 'Firebase/Crash'
pod 'TwitterKit'
pod 'Fabric'
pod 'Crashlytics' end
I tried to uninstall - install cocoapods.
I tried to deintegrate pod from project, install, remove .workspace file and deriveData folder... still got these errors.
I'm running out of ideas. Please, any other solution?
Thanks you very much
EDIT
I have just discovered that my Pods.framework is in red state as visible on screenshot below. Maybe this can help?
First try to remove cocoa pods completely
gem install cocoapods-deintegrate
pod deintegrate
gem install cocoapods-clean
pod clean
Then install again like this
pod setup
open -a Xcode Podfile
In Pod file add like this
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'TestProject' do
pod 'Firebase'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
pod 'Firebase/Messaging'
pod 'Firebase/Crash'
pod 'TwitterKit'
pod 'Fabric'
pod 'Crashlytics'
end
target 'ProjectTests' do
end
pod install
Updating Xcode can resolve this issue. Thing is, pods might support multiple swift versions, so pods should be able to specify a range of swift versions.
Before Updating check if PODS_ROOT user-definer value in Build Settings of target is not deleted may be accidently. If so Try to add PODS_ROOT=${SRCROOT}/Pods
It's possible that you use old pods repositories and after update (that was few month ago) you need to specify which pod repository to use. I suggest that you need old one. See how looks my pod file for old project:
source 'https://github.com/CocoaPods/Old-Specs.git'
platform :ios, '9.0'
use_frameworks!
xcodeproj 'SF'
#link_with 'SF'
target 'SF' do
pod 'TransitionKit'
pod 'MBProgressHUD'
pod 'PureLayout'
pod 'UICountingLabel'
pod 'MWPhotoBrowser', :git => 'https://github.com/pash3r/MWPhotoBrowser.git', :branch => 'skyFlyWork'
end
What could cause the issue:
- Breaking changes in Pods/APIs
- Breaking changes due to support/non-support of Swift versions
If you are using a versioning system (Git, etc.).
Retrieve an older version of Podfile.lock.
Read that file (it's a text file, you can do more somePath/Podfile.lock in Terminal.app), and the "explicit" versions of your pods should be there.
You should get something like:
PODS:
- GSKStretchyHeaderView (1.0.3)
- Masonry (1.1.0)
...
PODFILE CHECKSUM: someCheckSum
COCOAPODS: 1.1.1
When you do pod 'Firebase' you don't specify a version, so you should get the last one. But if some versions are not compatible, you can get issues.
So you may add the '~> 1.0.3' (for instance if I take my example of GSKStretchyHeaderView). More informations on how to use it here.
So this way you should get back on a older version when everything was working. Now, you can check the documentation of each pods (and their respective podspec looking for "hidden" dependencies) and update them one by one checking which one is the culprit, and then maybe rising a flag (an issue) on their repo/git if needed.
For next dev, I'd suggest to set "version", to at least majors using the "optimistic operator ~>". If they respect the rules of versions, (major/minor/patch), then at least determine the major/minor, a patch shouldn't break anything, but fix things. A minor may have breaking change, while a major has a lot of probability to not be compatible with previous work (different declaration, classes renames, etc.).
If you don't use a versioning system like Git, I STRONGLY suggest you do now.
But if that's your case and you still have the issue. Remember a date when everything was working fine after a pod update/install. Then, go to each Git of your pods, and read the history to find the version at that date and set that version in your podfile for that pod.
Shen you are doing pod update which update all libraries most of the libraries on swift4 still some of them in swift3
If libraries are in swift 4 and your project in swift 3.2 you have two possibilities
you can migrate project to swift4
(or)
you need to rollback to the swift 3.2 supported pods
If project in swift4 libraries in swift3 you need to migrate those libraries into swift4 to solve current problem

How to install new pods witout affecting other pods?

I'm facing a problem with my pods.
I edited some pods, and when I request a new pods using "pod install", the edited pods will be cleaned and installed again.
Is there a way to install new pods or update specific one without affecting others?
No. When you install new pods, all the pods will be reset accordingly. If you need to make changes to an API you want, you should rather add it in your project manually instead of using it as a pod.
This way, you can add any amount of pods without affecting that particular API, and your changes will be saved properly as well.
Actually, there is a workaround: just specify exact versions of pods in your Podfile.
For example:
Podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
target 'TestApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for TestApp
pod 'RxSwift', '4.1.2'
pod 'RxCocoa', '4.1.2'
pod 'Alamofire', '4.6'
pod 'SwiftyJSON', '4.0'
pod 'ObjectMapper', '3.1'
pod 'SVProgressHUD', '2.2', :inhibit_warnings => true
pod 'IQKeyboardManagerSwift', '5.0.7'
pod 'Validator', '3.0', :inhibit_warnings => true
end
As you can see in my Podfile all pods have exact specified versions (i.e. without ~>).
So if you add your pod in this kind of Podfile, then only it will be installed, cause the other ones are already installed.

Resources