Getting errors in podfile - ios

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.

Related

Tons of issues with Alamofire when compiling xcode project

I was running my program softly and at some point (maybe closed the Xcode to reopen or updated pod file) it suddenly it can't compile anymore.
I already tried opening .xcodeproj and .xcworkspace. The first one shows this message when compiling:
The second case shows tons of issues:
This is my pod file:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
source 'https://github.com/CocoaPods/Specs.git'
target 'HonoluluArt' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
# Pods for HonoluluArt
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
pod 'GoogleMaps'
pod 'GooglePlaces'
end
Can I get any help? Thanks a lot!
try to clear pods and reinstall:
in the project folder execute: pod deintegrate
then clean pods: pod clean
Reinstall pods: pod install
this should work
also if you don't need in particular the v3 of Alamofire remove ~> 3 to install the latest version and modify your Podfile:
target 'HonoluluArt' do
use_frameworks!
pod 'Alamofire'
pod 'GoogleMaps'
pod 'GooglePlaces'
end
Alamofire ~> 3.0 is written in Swift 3. Podfile shows that this is an older codebase. You could try building you project with older version of Xcode (xCode 10.0 is last version supporting Swift 3) or you should upgrade Alamofire to actual version ~> 5.0 (you will also need to upgrade project codebase to newer Swift version).
You indicated you opened the project file and compiled. Cocoa Pod instructions clearly state after installing, you should only work in the .xcworkspace file thereafter. Can you open that and try a compile?
I just removed any reference to Alamofire. Pod file, imports, paths and stuff and it worked. I'm trying to manage the code once it is removed, but worked.
Thanks anyway!

Why is there an error in swift grammar

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.

Always get build error : No such module 'Alamofire'

I followed the instruction of Alamofire in github,
I created an xcode project named cocoapods-test & I closed it.
I go to the project folder run pod init command which generates a Podfile. Then I added the following code to the Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
Then, I run command pod install and this is the result in terminal:
Updating local specs repositories
CocoaPods 1.0.0.beta.6 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Analyzing dependencies
Downloading dependencies
Installing Alamofire (3.3.0)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `cocoapods-test.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
Then, in my project folder there is a new file called cocoapods-test.xcworkspace . I double clicked it which opens my xcode again, and I can see the Alamofire module.
Then, I opened my project's ViewController class, and import Alamofire . But no matter how many times I clean & build, I always get error No such module 'Alamofire' . Here is the screenshot:
Why I get this problem though I followed the instruction step by step?
(I am using XCode 7.2.1, Swift 2.1.1 & Alamofire 3.3.0)
======= UPDATE ========
I tried #LK Yeung 's answer, uncomment import Alamofire, then clean & build again, I got a bunch of compiler errors from Alarmofire:
You need to build the project successfully once before using the library
comment import Alamofire -> build -> uncomment import Alamofire
Make sure you have opened the "project_name".xcworkspace instead of "project_name".xcodeproj .As you are working on pods all the installed pod will be available only in your .xcworkspace project file.
I was having this exact same problem. Please make sure that you are on Xcode 7.3 and using Swift 2.2.
You can check your Swift version using xcrun swift -version. Updating Xcode to 7.3 should also automatically update Swift.
Updating Xcode resolved this issue for me.
You need to add the lib to 'the Link Binary With Libraries' section also
You can try put pod 'Alamofire', '~> 3.0' like below. And run pod install again.
target 'yourtarget' do
pod 'Alamofire', '~> 3.0'
end
If you're manually installing Alamofire (or any other framework) make sure your build configurations match between both your parent project and the sub project. For example, if your build configuration in your project is called 'Development', but Alamofire's is called 'Debug' you'll get the 'no such module' error.
Follow This Sequence
➼ Open Terminal, go to the project folder and run these commands:
sudo gem install cocoapods -n /usr/local/bin
pod install
➼ Go to this link and clear derive data folder:
~/Library/Developer/Xcode/DerivedData
➼ Then open project "xcworkspace" file and press:
Command + Shift + K
➼ and then:
Command + B
It should work now
Cheers!
try to latest updated install alamofire and also check u use alamofire latest is this in your xcode supported.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'Alamofire', '~> 4.4'
end
try this above alamofire on your podfile
I had the same issue, the reason was that I installed the wrong version of alamofire.
I am using Xcode 7.3, swift 2.2, so alamofire 3.0 worked for me
remove the library using these steps mentioned by #Michal
Remove or uninstall library previously added : cocoapods
Then in your pod file
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, ‘9.3’ <-- your target version
use_frameworks!
target ’<your target name>’ do
pod 'Alamofire', '~> 3.0’
end
No such module 'Alamofire' Error
because you have not installed the Alamofire in your pod file
open Podfile and add this line
pod 'Alamofire'
double-check in Podfile if this line already is written then no need to write. then just update pod file
for updating your pod open your Podfile into terminal and dial
pod update

Alamofire won't build in empty Swift project using Cocoapods

I am starting a project by creating a blank Single-View app for Swift. Using Cocoapods, I am adding Alamofire as follows:
platform :ios, "8.0"
use_frameworks!
target 'TestGauge' do
pod 'Alamofire', '~> 3.0'
end
target 'TestGaugeTests' do
end
Then, in Terminal I run pod install
When returning to XCode, the project fails to build with 1000+ errors generated from Alamofire.
I am running XCode from the workspace file and NOT the project file.
XCode version 6.4
Has anyone had this behavior, or can anyone offer a solution? Have I missed a critical step?
Thanks!
Alamofire 3.0 is written in Swift 2.0. Xcode 6.4 does not support Swift 2.0. Change Alamofire version or update your Xcode.

Objective C Project in Xcode 7 CocoaPods Error

The Terminal Error I am receiving after running pod install is:
I realize that ReactiveCocoa's cocoapod is entirely in SWIFT and that I need to Bridge the header files, but my attempts have been far from successful.
I did find this response from one of TeamTreehouse's Staff:
"The SimpleAuth library has it's own set of dependencies one of which is ReactiveCocoa. ReactiveCocoa was recently rewritten completely in Swift so that's the Swift code that's getting added to your project. Unfortunately there are 2 versions of ReactiveCocoa out there, written in Swift 1.2 and Swift 2.0.
SimpleAuth is currently automatically pulling the 1.2 version of ReactiveCocoa.
Swift 1.2 can only be run in Xcode 6.1 and not in Xcode 7 (which requires Swift 2).
So if you are using Xcode 7, then you're pulling in the Swift 1.2 version by default and this is causing all the Swift errors.
Also, you have to do some cleanup work to get Swift frameworks to run in a mixed Objective-C/Swift project which includes adding a bridging header and stuff."
.
^^ Explains my Problem ^^
Thanks in advance!
Edit
After adding use_frameworks! to my Podfile, I was receiving errors like:
The error message says to add the line use_frameworks! to your file called Podfile.
Add it below the first line that should probably say platform :ios, 'x.0'.
You need to use ReactiveCocoa 4.0, which is target Swift 2.0, yet still under alpha version.
If you want to have a try, check this out.
use_frameworks!
target 'YOUR_TARGET' do
pod 'ReactiveCocoa', '~> 4.0.0-alpha'
end
After attempting use_frameworks! within my pod file, I was still experiencing errors due to ReactiveCocoa and the .swift files (even after auto-correcting the errors that Xcode attempted to fix for me).
Within my Podfile I was able to resolve both sets of errors I was experiencing:
1. When including use_frameworks! in the Podfile
2. Also when running my original pod install in hopes of adding the Parse cocoapod
Final code in Podfile
pod 'ReactiveCocoa', '2.4.7'
pod 'SimpleAuth/Instagram', '0.3.6'
pod 'SSKeychain'
pod 'Parse'
You can actually request the latest version of the dependencies. Your Podfile should look like this:
platform :ios, "9.0"
use_frameworks!
target 'MyAppNameHere' do
end
pod 'Box', :head
pod 'Result', :head
pod 'SimpleAuth/Instagram'
Then peform a pod update and in your project, Product > Clean and Product > Build and will work again.

Resources