Pods errors on xcode project - ios

I am trying to update my xCode project with latest libraries, but I have errors building my project. Here are the details:
xcode 13.4.1
Cocoapods 1.11.3
Here is my Podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'
target 'la soundbox' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'FirebaseCore'
pod 'FirebaseFirestore'
pod 'FirebaseAuth'
pod 'FirebaseMessaging'
pod 'FirebaseInAppMessaging'
pod 'FirebaseAnalytics'
pod 'FirebaseCrashlytics'
pod 'FirebaseRemoteConfig'
pod 'Google-Mobile-Ads-SDK'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end
Before installing anything, here is what I do:
Clear Build folder
Exit xCode
Run those commands
rm -rf ~/Library/Caches/CocoaPods
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf /path_to_project/Pods
rm /path_to_project/Podfile.lock
Restart mac
Launch xCode and build project
I have this error that keeps coming up (From FirebaseInAppMessaging pod, in FIRInAppMessaging.m):
'FirebaseCore/FIRAppInternal.h' file not found
Did not find header 'FIRAppInternal.h' in framework 'FirebaseCore'
What could be done to avoid this error ? I'm struggling on this and I really don't know what can I can do anymore

Related

I cannot build my ios product when I using product > archive in xcode

I cannot build my ios product when I using product > archive in xcode...
I used flutter to development and I had did run flutter ios build --release.
Then I go to xcode running product > archive, I get this error
Showing All Issues
Multiple commands produce '/Users/yomate/Library/Developer/Xcode/DerivedData/Runner-ddhhkruxpbzezodlfgvmogmaieov/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework':
1) Target 'GoogleUtilities-00567490' has create directory command with output '/Users/yomate/Library/Developer/Xcode/DerivedData/Runner-ddhhkruxpbzezodlfgvmogmaieov/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'
2) Target 'GoogleUtilities-54e75ca4' has create directory command with output '/Users/yomate/Library/Developer/Xcode/DerivedData/Runner-ddhhkruxpbzezodlfgvmogmaieov/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'
Where has problem? I had did successful 2 days ago, but I need to update the version now, it was got error
tried to add it in pod
target 'Runner' do
use_frameworks!
use_modular_headers!
pod 'GoogleUtilities', '7.7.0'
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
target 'ImageNotification' do
use_frameworks!
pod 'Firebase/Messaging'
pod 'GoogleUtilities', '7.7.0'
end

Unable to build project with Stream Chat iOS SDK

I'm trying to use the new Stream iOS Chat SDK and am unable to get it to build after I install it via Cocoapods. The project was building with the other pods listed before we added StreamChat. I am using Xcode 10.2 (Does not work with 10.1), Swift 4.2, and Cocoapods version 1.7.4. We used the pod install command listed on Stream's website:
pod install --repo-update
Our Podfile looks like this:
platform :ios, '11.0'
inhibit_all_warnings!
target 'Project-iOS' do
use_frameworks!
# Pods for Project-iOS
pod 'ReachabilitySwift', '4.3.0'
pod 'SwiftKeychainWrapper', '3.2.0'
pod 'CropViewController'
pod 'StreamChat'
target 'Project-iOSTests' do
inherit! :search_paths
# Pods for testing
end
target 'Project-iOSUITests' do
inherit! :search_paths
# Pods for testing
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
*Note that I tried this with and without the post_install bit at the end - but was having to manually change the pods to 4.2 since for many 5.0 isn't supported yet.
These are the errors I'm seeing when I try and build:
Edit: I also tried to get this running in a new blank project with just the StreamChat pod targeting iOS 11 (Basically just as the instructions on the site state for the ChatDemo) and ran into the same type of issues.
Related to your first question be sure to use Xcode 10.2 or later and Swift 5.
No need force pods to Swift 4.2. Try to remove these lines from your Podfile, then your project should compile without any errors:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end

swift linker command failed with exit code 1 Google Maps iOS Util pod install

My build failed with swift linker command failed with exit code 1. The logs specifically say symbol(s) not found for architecture x86_64
This happened ever since I tried setting up Google-Maps-iOS-Utils.
This is my Podfile. There is a pre_install portion because without it, pod install will have a 'Pods-Project' target has transitive dependencies that include static binaries error.
# platform :ios, '9.0'
target 'My App' do
use_frameworks!
platform :ios, '11.3'
# Pods for My App
pod 'GoogleMaps'
pod 'Google-Maps-iOS-Utils' #the new pod that caused issues
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'GoogleSignIn'
pod 'Firebase/Database'
pod 'Firebase/Storage'
pod 'FirebaseUI/Storage'
pod 'Fabric', '~> 1.7.9'
pod 'Crashlytics', '~> 3.10.5'
target 'My AppTests' do
inherit! :search_paths
# Pods for testing
end
end
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end
This is my Bridging-Header.h
#ifndef Bridging_Header_h
#define Bridging_Header_h
#import <Google-Maps-iOS-Utils/GMUMarkerClustering.h>
#endif /* Bridging_Header_h */
Some troubleshooting measures I tried:
Cleaning Build Folder and Building again;
de-integrating pods and pod installing again.
Any help is appreciated. Thanks.
This solution worked for me. There is no need for this portion in the Podfile as well.
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end
I also had to delete the framework the binary search path in Build Phases.
Try to add library location in binary search path of build setting.

Remove deprecated iOS framework warning in specific pod

I'm trying to not see this warning in the Atlas pod since its not my library.
'UIMutableUserNotificationCategory' is deprecated: first deprecated in
iOS 10.0 - Use UserNotifications Framework's UNNotificationCategory
I am using
inhibit_all_warnings!
in my pod file.
I also tried pod 'Atlas', '1.1.5', :inhibit_warnings => true which didn't work.
I'm thought if I change the platform from iOS 9 to iOS like this
platform :ios, '9.0'
It would no longer show the warning.
update
-Wno-deprecated worked when I put it in Atlas build settings under complier flags -> c++ flags.
Any way to do this in the podfile? so a pod install will not break it.
Add to your podfile the following statement, and then run pod install
pod 'YourPodToIgnore', :inhibit_warnings => true
Any way to do this in the podfile? so a pod install will not break it.
In this way you can set it the build_settings for every target:
post_install do |installer|
installer.pods_project.targets.each do |target|
installer.pods_project.build_configurations.each do |config|
config.build_settings['OTHER_CFLAGS'] = "-Wno-deprecated"
end
end
end

Prevent "There are multiple dependencies with different sources" using CocoaPods

I use a combination of own and external pods in several projects. If I'm developing or updating a pod, I use a Podfile.local to avoid versioning/tagging every single change. The issue here, if that I must update Podfile to comment out every pod I'm using in Podfile.local to avoid errors.
Is there any way of telling cocoapods that should consider Podfile.local over Podfile when both files have the same pod to prevent this errors:
Analyzing dependencies [!] There are multiple dependencies with
different sources for Analytics in Podfile:
Analytics (HEAD)
Analytics (from ~/Documents/analytics_ios)
My Podfile:
source 'https://github.com/CocoaPods/Specs.git'
source 'http://gitlab.whatever.com/podfolder/cocoapods_ios.git'
platform :ios, '7.0'
# Allows per-dev overrides
local_podfile = "Podfile.local"
eval(File.open(local_podfile).read) if File.exist? local_podfile
pod 'Advertising/Dfp', :head
pod 'RSSParser', :head
pod 'DTCoreText'
pod "AFNetworking", "~> 2.0"
pod 'OurKeyboard', :head
pod 'VideoPlayer/GooglePrerollForAdMob', :head
pod 'Analytics', :head
pod 'AppVersioning', :head
My Podfile.local:
pod 'Analytics', :path => '~/Documents/analytics_ios'
The Podfile.local trick is no longer possible since CocoaPods 0.35 and was never officially supported.
See https://github.com/CocoaPods/CocoaPods/issues/2860
This same issue occurred when installing pod in Watch extension in existing application in Configuration :- Swift-3,Xcode-8.1 and Pod-version 1.0.1.
Existing Podfile With above error :
platform :ios, ‘10.0’ source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target "DemoApp" do
pod 'SwiftQRCode'
pod 'Alamofire'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3'
end
end
end
target 'WatchExtension' do
platform :watchos, '2.0'
pod 'Alamofire'
pod 'SwiftyJSON'
end
pod install
Solution:
Create the shared definition which can be shared between main app bundle and watch OS extension :-
Updated podfile : source 'https://github.com/CocoaPods/Specs.git'
#Create common defination to share the library between app and extension
def shared_pods
pod'Alamofire'
pod 'SwiftyJSON'
end
target "DemoApp" do
platform :ios, '10.0'
use_frameworks!
shared_pods
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3'
end
end
end
target 'WatchExtension' do
platform :watchos, '2.0'
use_frameworks!
shared_pods
end
So, Change in podfile has resolved above issue of "multiple dependencies with different sources....".
Need to update Library search path :-
My problem was that I had two same packages. One was deprecated other one was new just installed by me, but I didn't uninstall the deprecated package. So the new package was adding one dependency to my Podfile and the deprecated package was adding same the dependency, but from different source. I'd to uninstall the deprecated package and the error has gone.

Resources