I want to use some Swift pods in my Objective-C app, so I need to use frameworks instead of static libraries. But enabling use_frameworks!
in my Podfile causes tones of #import
errors.
My Podfile:
platform :ios, '8.0'
use_frameworks!
pod 'AFNetworking', '2.6.0'
pod 'Typhoon'
pod 'SSKeychain'
pod 'JBWebViewController'
pod 'TTTAttributedLabel'
pod 'HockeySDK'
pod 'GoogleAnalytics'
pod 'Intercom'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'UIButton+Activity'
pod 'HexColors'
pod 'AFNetworkActivityLogger'
pod 'HCSStarRatingView', :git => 'https://github.com/hsousa/HCSStarRatingView.git'
pod 'LGSideMenuController'
pod 'DateTools'
pod 'SDWebImage'
pod 'SSCWhatsAppActivity'
pod 'UIViewController+BlockSegue'
The first problem was with SSKeychain
pod:
In code I'm including SSKeychain using "quotes" #import "SSKeychain/SSKeychain.h"
, but if I understand right, I need to use <angle>
from now #import <SSKeychain/SSKeychain.h>
? But in this case I receive same error, but in my code.
My Build Phases:
Anyway I have found fork of SSKeychain with "quotes" import (https://github.com/adamwulf/sskeychain/commit/2b7fd878415e8e4f23f74636cdd8c993466d0749) and switched to those version.
But now I have same issue with many other pods (almost with all of them):
Import in app: #import "FBSDKCoreKit/FBSDKCoreKit.h"
Do I really need to fork each repo and change import statements?? Or I'm including pods in wrong way?
PS: I'm cleaning derived data and project before each build attempt.
Cocoapods Version: 0.39.0
As you've used Modules in your Podfile, why don't you just:
@import SSKeychain;
instead of:
#import <SSKeychain/SSKeychain.h>
To test that:
I have finally figured out it! The problem was fixed by removing Pods.framework
from Link Binary With Libraries and adding them again manually.
Thanks for help!
Also check error messages on pod install
.
In my case I was using a custom import in FRAMEWORK_SEARCH_PATHS
, and just because I was doing that, whenever I did pod install
the extra search paths that CocoaPods adds were not being added. So I had to remove my custom path and then they showed up. Then I added my custom path.
Might be a good idea to do pod deintegrate
, delete de xcworkspace file and do pod install
once more. Then add your custom build settings.
This is the error I was getting:
[!] The App [Debug] target overrides the FRAMEWORK_SEARCH_PATHS
build setting defined in Pods/Target Support Files/Pods-AppLib/Pods-AppLib.debug.xcconfig.
This can lead to problems with the CocoaPods installation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With