Remove deprecated iOS framework warning in specific pod - ios

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

Related

'React/RCTViewManager.h' file not found from FBSDK in react native 0.60

I recently upgraded react-native to version 0.60. As a consequence, my Podfile looks like this:
target 'myProject' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for myProject
# this is very important to have!
rn_path = '../node_modules/react-native'
pod 'React', :path => '../node_modules/react-native'
pod 'React-Core', :path => '../node_modules/react-native/React'
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
...
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
One of the project dependencies is FBSDK, as it is shown above.
The problem is that this dependency relies on React pod instead of React-Core, so the build fails because some modules are not found using the path React/Module:
Xcode, File RCTFBSDKMessageDialog.h (from the pod react-native-fbsdk):
#import <React/RCTBridgeModule.h>
#import <FBSDKShareKit/FBSDKShareKit.h>
#interface RCTFBSDKMessageDialog : NSObject <RCTBridgeModule>
#end
I get the error: error 'React/RCTBridgeModule.h' file not found
If I change it for React-Core/React/RCTBridgeModule.h it works.
Any idea to make it work without renaming all the references?
I solved it finally.
The problem was on the Podfile, the last part was removing React from the ios project target(I had this for the previous React version):
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "React"
target.remove_from_project
end
end
end
And I had to add this lines as well (from React Native Upgrade helper):
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
...
use_native_modules!
So, in conclusion, the problem was that after upgrading to 0.60, the Podfile was not correctly upgraded so React module was not added to the iOS target.

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

Pod Install Error Mapbox

Hi i am Install pod of Mapbox. I am getting following Error.
The Swift pod MapboxCoreNavigation depends upon MapboxMobileEvents, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies.
This is my Pod File
source 'https://github.com/CocoaPods/Specs.git'
target ‘DailyWages’ do
pod 'GoogleMaps'
pod 'GooglePlaces'
pod 'MapboxNavigation'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0'
end
end
end
Please Help.Any Help Would be Appreciated.
"use_modular_headers!" helped me.
Add it after this line: "target ‘DailyWages’ do"

Swift 3.0 xCode 8 Migration pod

i have some problems with xCode 8.
I have converted my .xCodeproject in swift 3.0 sintax
i Have installed all cocoapods compatible with swift 3.0
Here my pods
So every pod require the legacy swift version OR xCode return ditto error OR xCode return some error about the pods sintax. Please help me.
to remove the pods requiring legacy swift version manually changed to YES task, add this script to your podfile. It will go through your pods and set it to use the 3.0 version
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |configuration|
configuration.build_settings['SWIFT_VERSION'] = "3.0"
end
end
end
1.latest xcode 8
2.if already pod file created in your project so then u do this command
open -e podfile
and then
use_frameworks!
target '<your project name>' do
pod 'Alamofire', '~> 4.4'
//your all pod put here above 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