I am using various Swift and Objective-C libraries in my (Swift) project. My Podfile looks as follows:
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod 'FBSDKLoginKit'
pod 'Fabric'
pod 'TwitterKit'
pod 'SimpleAuth/Instagram'
pod 'AFNetworking', '~> 3.0'
pod 'Parse'
To have support for using both (Swift and Objective-C) libraries, I use use_framework! directive in Podfile to install and use them. If we use directive use_framework! for Objective-C libraries, we are not required to create any kind of bridging-header.h and we can use it directly by import ModuleName. I am having no issues with any of the above mentioned pods/frameworks while installing or using them.
But there is this one framework which is written in Objective-C and I install it by adding its entry in Podfile as pod 'CleverTap-iOS-SDK'. The installations goes well but when I try to import CleverTapSDK or import CleverTap to use the library, it is giving me no such module error.
Just in case: My Xcode version is - 7.3 (7D175)
Related
So I recently converted an old swift 3.2 project to a 4.2(quite the jump, i know).
I am getting these errors:
Here is my Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target 'app' do
pod 'Alamofire', '~> 4.0'
pod 'EVReflection/XML'
pod 'FontAwesomeKit', :git => 'https://github.com/PrideChung/FontAwesomeKit.git'
pod 'SVProgressHUD'
pod 'PageMenu', :git=> 'https://github.com/orazz/PageMenu.git'
pod 'Kingfisher', '~> 3.0.0'
pod 'RichEditorView'
pod 'SwiftKeychainWrapper'
pod 'FacebookCore'
pod 'CHTCollectionViewWaterfallLayout/Swift'
pod 'FacebookLogin'
pod 'FacebookShare'
pod 'Fuzi', '~> 1.0.0'
end
does this look correct?
Thank you for any insights
First, run pod install
And then, check if the version of your pods, probably they are not compatible with Swift 4.2, so you have to update then, or change the "Swift language version" on Pod inspector to swift 3.2 like that way:
Select the "Pod" project in project navigator:
Select your pod on Targets selector:
And on "Build settings" tab, find and change the "Swift language version" property:
Note: You can get away of this problem this way, but i highly recommend that you update your pods.
I been struguling with this for hours now, I can't understand what is wrong. I followed googles iOS cluster setup carefully, but no mater what I do it doesn't work. I'm getting this error:
.../Pods/Google-Maps-iOS-Utils/src/Clustering/Algo/GMUNonHierarchicalDistanceBasedAlgorithm.m:22:9: 'GoogleMaps/GMSGeometryUtils.h' file not found
I have installed the following:
Using Alamofire (3.4.1)
Using Google-Maps-iOS-Utils (1.0.0)
Using GoogleMaps (1.9.2)
Pod file:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.3'
use_frameworks!
pre_install do |installer|
def installer.verify_no_static_framework_transitive_dependencies; end
end
target 'Happevents' do
pod 'GoogleMaps' # Objective-C pod
pod 'Google-Maps-iOS-Utils' # Objective-C pod
pod 'Alamofire', '~> 3.4' # Swift pod
end
I installed Google-Maps-iOS-Utils in my project by pod installation. Please update your pod file
target 'Happevents' do
pod 'GoogleMaps' # Objective-C pod
pod 'Google-Maps-iOS-Utils', :git => 'https://github.com/googlemaps/google-maps-ios-utils'
pod 'Alamofire', '~> 3.4' # Swift pod
end
You should remove use_frameworks! from your pod file
There is a manual from Google how to use their library with Swift and use_frameworks! you could also check this one.
I have been using pods not problem in my project. I recently added a pod to my podfile "HCSStarRatingView" which in the README says I need to add use_frameworks! at the top.
I did that and ran pod update. I am no longer able to #import <>, #import "" or #import any of my pods. Parse, MBProgressHUD, etc. None are found with any of those import statements. Also, HCSStarRatingView is not found with any combination of import statement either.
I have deleted my pods directory and ran pod install again, which did not fix the issue. My project does not have any Swift. I removed use_frameworks! (old pods work) but then I am still unable to import HCSStarRatingView. There are no issues for this on GitHub and I have not found any questions that help with my issue.
I have also cleaned my project as well as the build folder.
Very simple pod file:
use_frameworks!
pod 'MBProgressHUD'
pod 'Parse'
pod 'ParseFacebookUtilsV4'
pod 'ParseUI'
pod 'ParseCrashReporting'
pod 'RSKImageCropper'
pod 'CRToast'
pod 'JSQMessagesViewController'
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod 'FBSDKLoginKit'
pod 'HockeySDK', '~> 3.8'
pod 'SDWebImage', '~> 3.7'
pod 'UIActivityIndicator-for-SDWebImage', '~> 1.2'
pod 'MHVideoPhotoGallery', '~> 1.6'
pod 'TDOAuth', '~> 1.1'
pod 'HCSStarRatingView', '~> 1.4.3'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
pod 'GoogleMaps'
tl;dr; how to use old (what shouldn't use use_frameworks!) and new pods together in podfile?
I had working podfile:
platform :ios, '8.0'
use_frameworks!
target 'myApp' do
pod 'Alamofire', '1.3.1'
pod 'SwiftyJSON', '~> 2.2.1'
end
Then I added OneSignal pod according to documentation link
So my pod file changed to:
platform :ios, '8.0'
use_frameworks!
target 'myApp' do
pod 'Alamofire', '1.3.1'
pod 'SwiftyJSON', '~> 2.2.1'
pod 'OneSignal'
end
I updated pods and run build - got error:
ld: framework not found OneSignal
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I checked OneSignal pod and it looks differently compared to others:
Thats probably because is old style objective-c framework.
I can add this framework manually to my project but I wonder how to make it work properly with cocoapods?
This issue relates to my problem I think https://github.com/CocoaPods/CocoaPods/issues/3338
Update
I'm currently using Xcode 6.4
What version of Xcode are you using?
If update to the latest release versions of both Alamofire and SwiftyJSON and build with Xcode 7 it should fix your build errors.
platform :ios, '8.0'
use_frameworks!
target 'myApp' do
pod 'Alamofire', '2.0.2'
pod 'SwiftyJSON', '~> 2.3.0'
pod 'OneSignal'
end
I installed the following pods to my Swift project:
platform :ios, '8.0'
pod 'ParseUI', '~> 1.1.4'
pod 'Parse', '~> 1.7.5'
pod 'FBSDKCoreKit', '4.3.0'
pod 'FBSDKLoginKit', '4.3.0'
pod 'FBSDKShareKit', '4.3.0'
pod 'ParseFacebookUtilsV4', '~>1.7.5'
pod 'AFNetworking', '~> 2.5.4'
I added a Bridging Header for all the pods except the 3 FBSDKs. On https://developers.facebook.com/docs/ios/getting-started , it says...
"Swift
v4.1 of the SDK supports modules natively so no bridging headers are required. Simply import the appropriate kit module in your .swift files"
Problem is when I try to import those 3 frameworks to AppDelegate, I get the error message "No such module 'FBSDKCoreKit'"
Anyone encounter this issue before?
Thanks in advance.
Try adding use_frameworks! to the top of your podfile. It solved my problem. Initialy it is shown as #use_frameworks! in podfile . Remove the # infront of use_frameworks!. This blog explains about it.