I am trying to build a Xcode 5 project that uses CocoaPods. The POD file is following:
target "MyProjectName" do
pod 'AFNetworking', '2.2.1'
pod 'SVProgressHUD', '0.9'
pod 'MDHTMLLabel', :head
pod 'CCBottomRefreshControl'
pod 'EXPhotoViewer', '~> 1.1.2'
pod 'NHBalancedFlowLayout', '~> 0.2'
pod 'SevenSwitch', '~> 1.3.0'
pod 'REFormattedNumberField', '~> 1.1.5'
end
The cocoapods is installing and updating correctly.
The error is: Did not find the libraries, like the one highlighted in my .pch:
#import "SVProgressHud.h"
...
/Users/xyz/Documents/Projects/avbc/repo/ios/project/ProjectName-Prefix.pch:17:13: 'SVProgressHud.h' file not found
I already did the pod reinstalling steps from solution below, without success:
Cocoapods with Xcode 6 and 10.10 Yosemite
What should I do to build my project properly?
Try the following:
1) I usually set the platform on my pod file:
platform :ios, '7.0'
2) Have you linked the library with <>?:
#import <SVProgressHUD/SVProgressHUD.h>
3) It is HUD instead of Hud. (Uppercase) <- If you link to Hud the file will never be found
Perfom "Project Clean" (Cmd+Shift+K) to solve the problem.
Related
swift project is build and run ok in Xcode also AppCode,
but AppCode IDE report bellow error,I can not fix this .
I found UIProgressView can use progressView.snp but WKWebView can't ,
may be this is problem.
any one can help me ? Now I have to give up appcode .
see:
PodFile
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, "8.0"
use_frameworks!
target 'fruit-shop-ios' do
# pod '**', :git => 'http://**.git'
pod 'IQKeyboardManagerSwift' #,'4.0.10'
pod 'SnapKit', '~> 3.2.0'
# pod 'AFNetworking', '~> 3.0'
pod 'Alamofire', '~> 4.4'
end
the way is ignore the error.
Appcode to format and edit code, Xcode to run.
I'm trying to install an objective-c Wrapper for Jsip 'VialerSIPLib' and use it in my swift project here is my pod
platform :ios, ’10.0’
use_frameworks!
target 'EMedicalAdmin' do
pod 'ObjectMapper', '~> 2.1'
pod 'Alamofire', '~> 4.3'
pod 'SwiftyAvatar', '~> 1.0'
pod 'AlamofireImage', '~> 3.1'
pod 'Eureka', '~> 2.0.0-beta.1'
pod 'JSQMessagesViewController', :git => 'https://github.com/jessesquires/JSQMessagesViewController.git', :branch => 'develop'
pod 'PKHUD', '~> 4.0'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'ImageSlideshow', '~> 1.1.0'
pod 'SwiftyJSON'
pod "FlexibleSteppedProgressBar"
pod 'BTNavigationDropdownMenu', :git => 'https://github.com/PhamBaTho/BTNavigationDropdownMenu.git', :branch => 'swift-3.0'
pod 'VialerSIPLib'
end
but i get this error when installing :-
target has transitive dependencies that include static binaries:
and if i remove
use_frameworks!
from my podfile it would work but all my other swift based pods won't work
so, i'm left with using only this one pod (VialerSIPLib) or Use all my other pods except it
Please add this to your podspec: s.static_framework = true
This is available from cocoapods version 1.4.0.
It worked for me.!!
use_frameworks! should be enough but sometimes the pod.lock file gets corrupted.
So you can delete the pod.lock file and then do
pod repo update and pod install
if any one is Still wondring ,it can't be Done
Using dynamic vendored frameworks shouldn't be a problem even if the
developer isn't using CocoaPods with use_frameworks!, unless they for
some reason need a static lib, such as if building a command line
tool, where static linking is preferable.
So .You Could add the static library manually and link it in you project or wait for the vendor to Change the library into a dynamic Framework
More info here
For me this is how i solved it :-
1- Downloaded the static library using Cocoapods without use_frameworks!
2- used Carthage for Adding other libraries
3- and if a library Doesn't have a Carthage support i would do it manually (Not advised since alot of Duplicate dependencies may Appear)
I put up a repo to show how to do: https://github.com/Lucashuang0802/CocoaPodsWithCarthage
There are a couple things to do:
- install your objective-c lib via CocoaPods without indicating use_framework! in the Podfile
- install your pure Swift module via Carthage
You should be able to compile fine with this solution.
It's a weird one.
For me uninstalling and installing again worked.
Steps -
Comment(#) the error causing pod in pod file
Pod install
Uncomment the line in pod file and save
Pod install
I have an Objective C project which has a podfile like this:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target 'Linbik' do
pod 'AFNetworking', '~> 2.6.0'
pod 'DateTools', '~> 1.6.1'
pod 'Sentry', :git => 'https://github.com/getsentry/sentry-swift.git', :tag => '2.1.3'
end
DateTools is an Objective C library, and Sentry is a Swift one.
If I remove Sentry pod and use_frameworks! line, and then run pod install, pods are correctly installed and project builds just fine.
But if I run pod install with the podfile above, pods are correctly installed but I can't build the project. It gives me an error like this:
'NSDate+DateTools.h' file not found with <angled> include; use "quotes" instead
The import is done like this:
#import <NSDate+DateTools.h>
This is just part of the code that gives me an error. There are also some imports like this:
#import <AFNetworking/UIImageView+AFNetworking.h>
That gives the same error.
Xcode suggests me to use double quotes on import, but that doesn't help.
What can I do?
I found the solution by deleting derived data.
Change pod 'AFNetworking', '~> 2.6.0' And use this
pod 'AFNetworking', '~> 3.0
pod 'DateTools', '~> 1.6.1'
pod 'Sentry', :git => 'https://github.com/getsentry/sentry-swift.git', :tag => '2.1.3'
After updating Xcode7 to Xcode 3 and migrate my code to swift 3, pods stopped working and show the following error.
ld: library not found for -lAFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I made sure the app is opened from the right icon.
I removed Afnetworking from Pods so it show same error in another one and so on.
I make sure the bit_enabled is set to yes.
I deleted the pod file, and workspace, everything related to pod and start over, same issue.
I edited the scheme and nothing too.
I removed and added $(inherited) again but nothing.
removed Xcode and installed it again
made sure the Xcode is looking to Xcode 8 commas line.
the cocoa pod version is cocoapods-1.2.0.beta.3
also here is the pods file
target 'MondoTaxiClient' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
#use_frameworks!
pod 'SocketRocket’, '~> 0.4'
pod 'GoogleMaps', '~> 1.10.5'
pod 'FBSDKCoreKit', '~> 4.9'
pod 'FBSDKLoginKit', '~> 4.9'
pod 'Parse'
pod 'SDWebImage', '~>3.7'
# pod 'Fabric', '~> 1.6'
pod 'Fabric'
pod 'Digits'
pod 'TwitterCore'
pod 'Crashlytics'
pod 'APAddressBook/Swift', '~> 0.2'
pod 'ActionSheetPicker-3.0', '~> 2.0.3'
pod 'Mixpanel', '~> 2.9'
pod 'Branch'
pod 'Adjust', '~> 4.6.0'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'Firebase/Crash'
pod 'AFNetworking', '~> 3.1'
end
the code target was iOS 7 + but after xcode 8 i made it iOS8+
if the solution is by downgrade cocoa pods please let me know which version.
some of the pods are conflicting with some of the static SDKs, frameworks once the conflict is resolved the issue disappear
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.