The tool involved is Xcode7.2, which is installed using CocoaPod
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
However, there is a large number of compilation errors as shown in the picture. Can I ask why are these errors?
The #selector special form was added in Swift 2.2, which is shipped with Xcode 7.3. You're using Xcode 7.2. You need to either upgrade Xcode, or use a slightly older version of AlamoFire.
Related
our project is an Objective-c project.
Since we're using react-native-firebase we can't use use_frameworks! in cocoapods any more.
The problem is we have a swift pod dependency (PromiseKit) and to use swift dependencies we must use use_frameworks! as far as I understand.
What I'm trying to do is have the best of both worlds, aka:
remove use_frameworks! so that react-native-firebase works AND
keep the PromiseKit swift dependency.
current Podfile:
platform :ios, '10.0'
target 'TestApp' do
use_frameworks!
# swift pod
pod 'PromiseKit'
# react-native-firebase
pod 'Firebase/Core', '~> 5.3.0'
pod 'Firebase/DynamicLinks', '~> 5.3.0'
pod 'Firebase/Messaging', '~> 5.3.0'
end
I noticed there's this command :modular_headers => true or use_modular_headers which I sense may or may not be relevant to the solution I'm looking for since Cocoapods 1.5 but I can't seem to connect the dots.
Edit:
If I remove use_frameworks! (even if I replace it with use_modular_headers!) I get this error:
Any help please?
Replace use_frameworks! with use_modular_headers! in the Podfile.
From the CocoaPods 1.5 release note referenced:
With CocoaPods 1.5.0, developers are no longer restricted into
specifying use_frameworks! in their Podfile in order to install pods
that use Swift. Interop with Objective-C should just work. However, if
your Swift pod depends on an Objective-C, pod you will need to enable
"modular headers" (see below) for that Objective-C pod.
With CocoaPods 1.9.0, it is now possible to build frameworks both statically and dynamically. Use use_frameworks! :linkage => :static
I have also faced this issue. and find a perfect solution for this.
https://github.com/joncardasis/cocoapods-user-defined-build-types
this is a plugin for cocoapods by which we can specify to use "dynamic framework" (i.e. what "use_framework" does) on a particular pod. this feature is not currently supported in cocoapods, that is why use this plugin to resolve your issue.
I ran into a similar issue last week, so I created a basic project where I'm using Swift, Firebase but not use_frameworks!, instead using bridging headers.
Don't know if people are still having issues with this, let me know if it helps. https://github.com/jenshandersson/React-Native-Swift
I install SCLAlertView by using podfile.
I'm getting 300 errors on SCLAlertView.swift file.
I'm using Xcode 7.
How to resolve the problem.
Here is my podfile
platform :ios, '8.0'
target `SCLAlertView2` do
pod `SCLAlertView`
end
target `IceCreamShopTests` do
end
it generate podfile of SCLAlertView.swift but getting 300 error.
Xcode be it is latest version not work on xcode 7)
First
If you check in Branch you can find the swift 2.3 supported version of SCLAlertView
https://github.com/vikmeup/SCLAlertView-Swift/tree/swift-2.3
You can directly use instead of installing cocoapods.
Second
If you check SCLAlertView.podspec you can find the version of cocoapods then you can install that via pods by
pod 'SCLAlertView', '~> 0.6'
If you want to support xcode 7.3 and swift 2.3 other wise if you use swift 3+ then use
pod 'SCLAlertView', '~> 0.7'
Hope that information get your issue fixed.
What is the way to integrate Alamofire with Swift 3.0 and also have to provide support for iOS 8 ? Is there any other option then Alamofire ?
Upgrading to the latest Cocoapods do like this
gem install cocoapods --pre
seems to solve the issue for my circumstance.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
above this line only specification use this alamofire platform if u want all platform then remove this platform line and second thing is deployment target select 8.0 so all platform in use alamofire.
use_frameworks!
target '<Your Target Name>' do
pod 'Alamofire', '~> 4.4'
end
I posted a similar question yesterday but please bear with me. I am trying to install libraries such as ObjectMapper, Alamofire, etc. using Cocoapods (updated to latest version). I can successfully install the pods but as soon as I open <>.xcworkspace, I get build errors in the library files. I had installed SwiftyJSON a month ago using CocoaPods and it didn't give me a problem at the time. I tried installing SwiftJSON in an entirely new project using CocoaPods and it is giving me the build issues now. Please help! There are no references for this!
My current Cocoapods version is 0.38.2. My project's deployment target is 8.4.
This is my Podfile
# Uncomment this line to define a global platform for your project
# platform :ios, '6.0'
target 'retailcatalogue' do
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'SwiftyJSON'
end
target 'retailcatalogueTests' do
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'SwiftyJSON'
end
My current version of Xcode is Version 6.4 (6E35b). Could that be a factor?
I just updated my Xcode to 7.0.1 and everything's working great! Thank you everyone!
Try using this:
use_frameworks!
target 'retailcatalogue' do
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
end
I have a project running on Swift 1.2 and iOS 8.4.
After the update to Swift 2 and iOS 9, I did "pod update" to update my pods.
Now there is an Pods-Alamofire error: "Swift is not supported for static libraries."
Any ideas how to fix this?
If you are using cocoapods, make sure that you are using the right version of Alamofire
pod 'Alamofire', '~> 2.0' //2.0 is currently the latest version
Also make sure you are using use_frameworks! so your Profile should look like this:
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 2.0'
The use_framworks! part tells CocoaPods that your project is using frameworks instead of static libraries.
In order to use Pods written in Swift, you must explicitly include use_frameworks! to opt into using frameworks. If you forget to include this, and CocoaPods detects you’re trying to use a Swift CocoaPod, you’ll get an error when you try to install the pods.
If you’ve only ever programmed in Swift, this may look a bit strange − that’s because the Podfile is actually written in Ruby. You don’t need to know Ruby to use CocoaPods, but you should be aware that even minor text errors will typically cause CocoaPods to throw an error.
Credit: Ray Wenderlich
Add use_frameworks! below platform on your pod file. This way your pod will be added as framework and not as static library