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?
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
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"
Is there any way to access the apps target names (and NOT the pods target name) within the post_install cocoa-pods script?
platform :ios, '9.0'
target 'MyProject' do
pod '...'
end
post_install do |installer|
# i need my application target 'MyProject' here
end
I use CocoaPods to manage dependencies in my project. I've written Podfile:
target 'MyApp' do
platform :ios, '8.0'
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
#use_frameworks!
# Pods for MyApp
pod 'KeepLayout', :git => 'https://github.com/iMartinKiss/KeepLayout', :tag => 'v1.6.0'
pod 'EasyMapping'
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'MyAppUITests' do
inherit! :search_paths
# Pods for testing
end
end
This file works well with CocoaPods 0.x but I can't compile project after I've updated to CocoaPods 1.0. After I've run
pod update
I can't compile my project with error:
/Users/<...>/Pods/KeepLayout/Sources/KeepAttribute.m:195:1: Cannot synthesize weak property because the current deployment target does not support weak references
I've seen that every library is builded with different deployment target. For example KeepLayout is builded with 4.3 deployment target.
How I can determine build target for every pod dependency?
While some development versions of CocoaPods (as well as pre-1.0 versions) may have propagated the deployment target of the project down to the pods, this is no longer the case in 1.0. To work around this, the current developer recommends using a post-install hook.
Here's a brute force approach to force a hard-coded deployment target for every pod in the generated Pods project. Paste this at the end of your Podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.2'
end
end
end
Since the Podfile uses a directive like platform :ios, '9.0' to specify "iOS Deployment Target" (aka IPHONEOS_DEPLOYMENT_TARGET) for the Pods/Pods.xcodeproj project, you just need to remove the Deployment Target info from each build target.
Do it by adding this to your Podfile
platform :ios, '9.0' # set IPHONEOS_DEPLOYMENT_TARGET for the pods project
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
Inspired by the github post and Alex Nauda's answer.
While the accepted answer by Alex Nauda is good, but letting the Pods inherit the target from the app might be a much better solution. 🚀
app_ios_deployment_target = Gem::Version.new('9.2') # Change to your current deployment target
platform :ios, app_ios_deployment_target.version
# Let Pods targets inherit deployment target from the app
# This solution is suggested here: https://github.com/CocoaPods/CocoaPods/issues/4859
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |configuration|
pod_ios_deployment_target = Gem::Version.new(configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
if pod_ios_deployment_target <= app_ios_deployment_target
configuration.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end
end
Here is the way to set deployment target permanently for pod targets.
Goto -> podfile -> Add below code
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "12.0"
end
end
end
change target to "11.0"
platform :ios, '11.0'
1) Search for IPHONEOS_DEPLOYMENT_TARGET
2) Change the iOS Deployment Target