Pod Result installed with ReactiveCocoa results in 56 compilation errors - ios

I'm following a Swift tutorial and need to use ReactiveCocoa, which I am trying to install with Cocoapods.
Very simple Podfile :
target 'MyAppTest' do
use_frameworks!
pod 'ReactiveCocoa'
end
Everything goes well with Cocoapods (although I don't know why I am getting the 4.0.1 version when the latest should be 5.0.0..? See here) :
But once in my project, I simply cannot build it. Here are all the errors I am getting :
I really don't know what to do...
Cocoapods version is 1.1.1 and Swift is 3.0.2.
Thanks for your help.

Related

MetaWear : Unable to build Cocoapod used in IOS application

I am attempting to use the MetaWear cocoapod to connect to BLE sensors from my IOS application. Before adding this pod, I created a basic Single View Application in Xcode. I tried to compile and run it on my iPhone, and it showed up as expected.
Having done this, I did a pod init, and updated my Podfile to look as follows, as recommended in the above MetaWear cocoapod link:
platform :ios, '12.2'
target 'myProj' do
use_frameworks!
pod 'MetaWear', '~> 3.2'
end
Once I run "pod install", I get the following output:
Analyzing dependencies
Downloading dependencies
Using Bolts-Swift (1.4.0)
Using MetaWear (3.2.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 2 total pods installed.
I then open my Xcode project ( myApp.xcworkspace ), and when I try to re-build the project, I keep getting this error:
Could not build Objective-C module 'BoltsSwift'
This is also shown in the following image:
As a result, I was under the impression that maybe I should downgrade the BoltsSwift version, but specifying something lower than 1.4, seems to be ignored. For example, I added this pod:
pod 'Bolts-Swift', '~> 1.3'
And my output after running pod install, still yielded "Using Bolts-Swift (1.4.0)". So I am not too sure how to get rid of this compilation failure. Maybe downgrading BoltsSwift is not the correct course of action. What can I try? (I am using Xcode Version 10.2.1 (10E1001))
Ok, turns out that by default, XCode set my Swift compilation to 5.0 for the BoltsSwift and MetaWear pod. I changed it to Swift 4, and I was able to build.
Updating the pods compilation level might also be a good idea, as described here :
How to set the Legacy Swift Version for each Pod in Podfile Xcode 9.0 Swift 3.2 / Swift 4.0

FBSDK swift 3 with 53 errors

I'm trying to download Facebook's sdk on Cocoapods following the instructions in the README
https://github.com/facebook/facebook-sdk-swift
I downloaded Cocoapods, inserted
pod 'FacebookCore'
pod 'FacebookLogin'
pod 'FacebookShare'
into my Podfile, executed pod install and opened my xcworkspace. But when I run my app I get 53 error messages like
"Function types cannot have argument label 'bytesSent'; use'_' instead"
I could try manually fixing these errors but is this supposed to happen?
I'm using Swift 3
Try clean and re-build the project or refactor it to the newest Swift syntax again. This seems to be a bug in the newest Xcode release (I exprerienced it in the previous version though).

Swift iOS project won't compile if I add any CocoaPod library

I'm new to iOS and am working on an app in Swift. I'd like to use CocoaPods for dependency management, but I am having issues. I've been able to install CocoaPods on my Mac, run pod init to create my pod file, and run pod install to install dependencies just fine. The .xcworkspace file was installed and I've been using it with my project.
My problem comes where after I add any pods to my pod file and run pod install, then go to build my app, there are errors with the pod files that get installed and the project wont build. I've tried a lot of different pods and all have similar errors. My guess is that the errors are related to the Swift version, but I'm not familiar enough with the tools to know how to adjust it.
The project will build fine if I remove the pods from the podfile and run a pod install again.
The errors are all over the files and are things like:
Expected declaration
Consecutive declarations on a line must be separated by ';'
Expected '{' after operator name in operator declaration
My environment specs
pod --version = 1.1.1
XCode Version = 8.2 beta (although I'm seeing the same issues on 8.1)
My podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'MySampleApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MySampleApp
pod 'Marshal', '~> 1.0'
pod 'FontAwesomeKit', '~> 2.2'
end
Also, the app I'm using is the starter sample app from AWS Mobile Hub. Everything works fine until I add a pod.
Any help would be much appreciated. I just don't know where to go from here.
I've found my problem. The Marshal library I was trying to use was not Swift 2.3 compatible (it was build for Swift 3). The AWS Mobile Hub sample app was using Swift 2.3, so I couldn't compile the two together. I decided to use a different library to parse JSON (pod 'SwiftyJSON', '2.4.0') and my app is building fine.

Does Facebook SDK support Swift 2.3/3.0?

Ok, I can't figure out what's the catch here. I follow all the instructions to configure my new project using CocoaPods to use Facebook SDK. Once I open generated project workspace, Xcode offers me to convert some source code in Pods project to Swift 2.3 or Swift 3.0.
I tried twice - with converting to Swift 3.0 and converting to Swift 2.3. Neither works and both give me on average ~120 compilation-time errors.
What's the deal here? I can't find anyone with similar problems. They seem to support Swift 2.3, but it doesn't work actually.
Xcode 8.0, Deployment target 8.0, latest FB sdk available through pods - 4.16.1
Facebook version 0.2.0 has support for Swift 3.0. Make sure you do the following before installing the latest version of Facebook SDK:
1: Get the latest version of Cocapods:
gem install cocoapods
(or if the above fails)
sudo gem install cocoapods
2: Update your local specs repo by running:
pod repo update
3: And then update your pod file and run pod update or pod install
pod 'FacebookCore'
pod 'FacebookLogin'
pod 'FacebookShare'
I think your probably missing step 1.

Trouble using AWSiOSSDKv2 via cocoapods 0.36 beta2

Using a Podfile like so:
platform :ios, '8.1'
source 'https://github.com/CocoaPods/Specs.git'
pod 'AWSiOSSDKv2'
I am getting a bunch of "file not found" errors in my xcode project related to the #imports being used in the AWSSDK. E.g. in AWSMobileAnalyticsContext.h:
#import "configuration/AWSMobileAnalyticsConfiguring.h"
I suspect this has to do with the fact that the project hasn't been updated with a dynamic framework output in mind (which is what the beta of cocoapods is using). I've gone through and actually tried hand-updating the paths to these imports, and I can clear most of the file not found errors, but then it starts complaining about the Mantle.h import elsewhere.
Anybody successfully gotten the AWSiOSSDKv2 to work with an app by using the cocoapods beta (or even a forked version that uses dynamic frameworks)?
I was able to get it to work today.
I deleted all traces of cocoapods since it had originally been installed using 0.35.
[project].xcworkspace
All mentions in [project].xcodeproj related to pods (yes, by hand with vim)
Pods/
Podfile and Podfile.lock
I then installed my swift pods using carthage instead. For me, this was Alamofire and SwiftyJSON.
I made a commit here, so I could easily go back to this point.
My podfile was just this, I could not get it to work with the use_frameworks! line.
target 'WhatsLegal' do
pod 'AWSiOSSDKv2'
pod 'Facebook-iOS-SDK'
end
I ran pod init and then pod install, and it started working from here!

Resources