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.
Related
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!
I'm trying to fix it for a couple of hours, but still without success.
I've got an iOS project from a company that needs some updates on that app. It was written in swift 2.3
My XCode version is 8.3.3 - when I opened the project, I got a message I have to convert the code to Swift 3
As a first thing, I updated pods dependencies
pod deintegrate
pod install
Here is my podfile if there's anybody interested to know
# Uncomment this line to define a global platform for your project
platform :ios, '10.2' #there was '8' when I got the code
# Uncomment this line if you're using Swift
use_frameworks!
workspace 'NaKoleIPesky'
target 'NaKoleIPesky' do
pod 'Alamofire'
pod 'HanekeSwift'
pod 'SwiftyJSON'
pod 'GoogleMaps'
pod 'SwiftLoader'
pod 'GooglePlacesAutocomplete', git: 'https://github.com/watsonbox/ios_google_places_autocomplete'
pod 'FRHyperLabel'
pod 'Google/Analytics'
pod 'GoogleConversionTracking'
end
I tried to convert the code (both pods packages and our code) to Swift3 via the Convert tool, but it returned with the error "Convert: Failed", popping up about 1700 buildtime errors. This is the list of files that tried to converts.
I press okay, but there's still a lot of compiler errors. Like these
or this one
probably wrongly converted, the original code was
self.handleResponse(data, response: response as? NSHTTPURLResponse, error: error, completion: completion)
Is the convert tool working bad? What can I do in this case? I don't want to rewrite all the code and fix 680 errors before I can compile something that was working before. I tried to Google a lot about this problem but no useful solutions were found.
Its frustrating seeing this error every time i use cocoa-pods. The only thing that works with cocoa-pods is 'Firebase SDK' but when i install any other framework such as JSQMessages or Eureka forms or any other framework i got an error 'No such a module" ... Its not the first time I work with these frameworks I did before and it was working correctly in fact I still got my previous projects installed with JSQMesgs, eurka..etc and its working fine till now. For the new projects it doesn't work/import in xcode anymore it is frustrating that I can't run it with this error ... not sure if its xcode or the cocopods .. I have tried instaling using terminal then uninstall and reinstall again with cocoapods application. I cleaned my build, change deployment target several times, and nothing worked so please if any one could share the same problems faced or advice me on how to avoid them or any alternatives to cocoapods.
deployment target 10.3 my xcode version 8.3.3 swift 3 macOS Sierra 10.12.5
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'FinalProject' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for FinalProject
pod 'Firebase/Core'
pod 'Firebase'
pod 'FirebaseAuth'
pod 'FirebaseDatabase'
pod 'FirebaseStorage'
pod 'ProgressHUD'
pod 'JSQMessagesViewController'
pod 'Eureka'
pod 'Former'
pod 'SwiftForms'
end
Please help.
Build the project.
The Xcode editor doesn't recognize modules coming from the Pods until after they've been built for the first time.
If that doesn't work for you, please share a screen shot of the issue, or even better, a reproducible example.
I had the same problem trying to work with SwiftyStoreKit.
I finally manage to solve my problem and hope that sharing the solution will help someone.
I tried everything was suggested until I realised that I was loading the pod in the wrong target, (in the pod file itself.)
After I repaired the pod file, run again pod install, and, voila, the xcode recognised the pod.
In Xcode 8 I'm having trouble importing any Swift 2.3 or 3 framework that was added with Cocoapods into my project.
There is a public umbrella.h file, but for some reason Xcode can't find the framework when I try to #import it.
As an example, create any Objective-C project, use the following Podfile, pod install, and then try the #import. It asks me to update the code to swift 2.3 or 3 even if that code is already Swift 2.3 or Swift 3 code. I've cleaned and tried to rebuild as well.
platform :ios, '8.0'
use_frameworks!
target 'testingFrameworks' do
pod 'SwiftyJSON'
end
Did I miss a step?
I used socketIO and was having the same problem. My solution to this is:
Close project.
Delete pod files, delivered files, pod framework, workspace file (clean up project)
pod install
Reopen workspace, upgrade swift syntax if xcode ask for, build a few times.
You might need to fix something for the new swift.
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!