Many build errors after pod update - ios

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

Related

Firestore installation using Cocoapods

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

Tons of issues with Alamofire when compiling xcode project

I was running my program softly and at some point (maybe closed the Xcode to reopen or updated pod file) it suddenly it can't compile anymore.
I already tried opening .xcodeproj and .xcworkspace. The first one shows this message when compiling:
The second case shows tons of issues:
This is my pod file:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
source 'https://github.com/CocoaPods/Specs.git'
target 'HonoluluArt' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
# Pods for HonoluluArt
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
pod 'GoogleMaps'
pod 'GooglePlaces'
end
Can I get any help? Thanks a lot!
try to clear pods and reinstall:
in the project folder execute: pod deintegrate
then clean pods: pod clean
Reinstall pods: pod install
this should work
also if you don't need in particular the v3 of Alamofire remove ~> 3 to install the latest version and modify your Podfile:
target 'HonoluluArt' do
use_frameworks!
pod 'Alamofire'
pod 'GoogleMaps'
pod 'GooglePlaces'
end
Alamofire ~> 3.0 is written in Swift 3. Podfile shows that this is an older codebase. You could try building you project with older version of Xcode (xCode 10.0 is last version supporting Swift 3) or you should upgrade Alamofire to actual version ~> 5.0 (you will also need to upgrade project codebase to newer Swift version).
You indicated you opened the project file and compiled. Cocoa Pod instructions clearly state after installing, you should only work in the .xcworkspace file thereafter. Can you open that and try a compile?
I just removed any reference to Alamofire. Pod file, imports, paths and stuff and it worked. I'm trying to manage the code once it is removed, but worked.
Thanks anyway!

IOS COCOAPOD with sources

I am trying to update the CocoaPods in my Xcode project, but when I try to run pod update, it doesn't work.
My podfile:
source 'https://github.com/MapQuest/podspecs-ios.git'
target 'FireBaseFixed' do
pod 'Firebase', '3.11.0'
pod 'MOCA'
pod 'MapQuestMaps'
end
And the response
daortiz:FireBaseFixed dortiz$ pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
[!] Unable to find a specification for `Firebase (= 3.11.0)`
[!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.
What I doing wrong?
Any reason you require Firebase 3.11.0 exactly?
To get the latest framework, use
pod 'Firebase'
Anyways, your problem is not the version, rather the sources, you seem to have omitted cocoapods main source and included only MapQuestMaps.
You also need to specify the version of MapQuestMaps as the are all pre-release versions and cocoapods will cry foul.
The code below fixes that.
source 'https://github.com/MapQuest/podspecs-ios.git'
source 'https://github.com/CocoaPods/Specs.git'
target 'FireBaseFixed' do
pod 'Firebase', '3.11.0'
pod 'MOCA'
pod 'MapQuestMaps', '3.4.1-1.1'
end
If the above doesn't work, sync your repo by running the following
pod repo update --verbose
Then run
pod install
Below is the working version of your podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
source 'https://github.com/MapQuest/podspecs-ios.git'
source 'https://github.com/CocoaPods/Specs.git'
target 'FireBaseFixed' do
pod 'Firebase'
pod 'MOCA'
pod 'MapQuestMaps’, '~>3.4.1-1.1'
end

Xcode Architecture issue

I am using xcode 6.4 in my project, it contains cocoapods where Pods are as follows:
pod 'ZXingObjC', '~> 3.0'
pod 'Google-Mobile-Ads-SDK'
pod 'iRate'
pod 'NewRelicAgent'
pod 'GoogleAnalytics'
pod 'Appirater'
pod 'Crashlytics'
But, after I update my pods I am getting the error which I attached to this image: Error is becuase of one pod
Need One project prefix header file
And add in bulid setting this .pch file.
So
FOR OBJECTIVE_C
yes this podfile should work,
FOR SWIFT add,this line too
use_frameworks!
YOU DON'T HAVE TO MENTION THE VeRSION OF ANY LIBRARY IF NOT MENTIONED ON COCOAPODS.
Lastly if you have taken care of all these
then try cleaning project cmd
+ shift+ k and then run project.
If still not working then delete manually the dependencies folders and reinstall them
# if there is problem with Google MobileAds-ios-Sdk, then you are stuck. Because there is some problem with them, and hence it would be better to install Google MobileAds-ios-Sdk manually only

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