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"
Related
I am working on an iOS project in swift 5 in Xcode 11.6 using cocoapods. Whenever I try to build it fails with the error message 'No Such Module FirebaseStorage'. I have tried deintegrating and installing several times. Below is the pod file I'm using. If I looking in the pods directory in the project folder, I can see a firebasestorage folder. I have also attached my header search path under the build settings for the workspace. header search path
Uncomment the next line to define a global platform for your project
platform :ios, '13.6'
#install! 'cocoapods', :disable_input_output_paths => true
target 'project' do
# use_modular_headers!
# Comment the next line if you don't want to use dynamic frameworks
# use_frameworks!
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'MessageKit'
pod 'Firebase/Firestore'
pod 'Firebase/Storage'
pod 'SDWebImage'
end
# Pods for project
target 'projectTests' do
inherit! :search_paths
# Pods for testing
end
target 'projectUITests' do
# Pods for testing
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if Gem::Version.new('8.0') >
Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
end
end
end
end
I was wondering what might be causing this issue?
Whenever I install a new pod project, and for example I install firebase libraries I always get installed libraries to be targeted for projects 8.0 or and I start changing them manually to be 9.0 or 14.0 because of the warning that I'm Getting.
Here it is the Podfile content:
platform :ios, '14.0'
target 'TestProject' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for TestProject
pod 'SDWebImageSwiftUI'
pod 'lottie-ios'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
end
How it is possible to update target iOS all at once, so I won't be updating all the libraries one by one?
Add this to your Podfile and then pod install.
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
end
end
end
This will update all the Pod targets at once to your desired version.
Depending on your Podfile, Warren's answer might not be enough to set all targets to the new deployment target. I recommend using this post-install handler:
deployment_target = '14.0'
post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target
end
end
project.build_configurations.each do |bc|
bc.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target
end
end
end
This addition becomes important when you use options like install! 'cocoapods', :generate_multiple_pod_projects => true
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
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
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.