Issue After Installing New Pods Into Project - cocoapods

I'm new to coding, so anything is appreciated! I created a project and realized I needed to install Alamofire into my project, instead of AFNetworking. Once I did this and uninstalled AFNetworking, I got dozens of errors. I read online that using the old Swift version and having a newer form of Alamofire can cause issues. So I needed to convert my code to Swift 3 by clicking edit, convert to latex swift context, etc. Once I did this, I got more issues as well. I have no clue what's all of a sudden wrong and how to fix this. What do I do? Attached are a list of errors. Thanks!

You need to update your code to Swift3. Not the Framework's code. Also you can check Framework's branches to find out if there is a Swift branch matching your version:
Alamofire for Swift3 = pod 'Alamofire', '~> 4.0'
Alamofire for Swift2 = pod 'Alamofire', '~> 3.5'

Related

Does anyone know where to get RxSwift Pod for xcode 10 and swift 4.2?

I tried a couple of variations in podfile to no avail...I assumed it was pod 'RxSwft', '-> 4.2' but get an error that is less than descriptive.
This works fine for me:
maybe you have another problem, can you add the error description?
And also I would recommend to always follow the page documentation:
there it still says to use 4.0, and even when i used in my podfile 4.0 it still installed (4.2.0) and i use the Xcode 10 beta, working fine.

XCode 8.2.1 error - No such module YouTubePlayer

I am using https://github.com/gilesvangruisen/Swift-YouTube-Player
First I've tried to import it manually from everywhere include dropping, copyng, embed framewordks, embedded binaries, linked frameworks, but it was unsuccessfully with error message No such module YouTubePlayer
Next I used cocoapods. Install it and run it from .xcworkspace. Then try to run it and again error message No such module YoutubePlayer
This is list tree directories after pod install
Maybe this is the solution, but I don't know where is repo and how to do the described action.
https://github.com/gilesvangruisen/Swift-YouTube-Player/issues/42
The reason why its failing with cocoapod is because the pod written is in old swift version. So, unless until we don't compile the pod successfully, we can't import that. You can change the old swift code to new using :
Xcode->Edit->Convert->To Current Swift Syntax
Also you can use the latest release and build the framework from the repo you mentioned:
https://github.com/gilesvangruisen/Swift-YouTube-Player
I downloaded the latest release and created the youTubePlayer framework and linked it to a sample app and able to import it.
Please check this link for the sample app which is having YouTubePlayer framework as well which you can use in your own project.

Local cocoapods sources in debugger displayed in asm in XCode 8

I am developing number of pods and store them in my own private repo. So I can install pods as usual, from this repository pod "SomePod", or install locally (Development pods) with pod "SomePod", :path => "~/SomePath/ToPod"
When using local pods (2-nd variant) in Xcode 8 I have no possibility to debug, because all sources, that come from pods, are displayed in asm, not in Objective-C, that they are written. In Xcode 7 everything was fine.
When using remote pods (default way, 1-st variant) pods are displayed in Objective-C, but editing them doesn't have impact on real pod sources, because I edit copied from repository version.
I use Cocoapods 1.0.1 version. In Xcode
"Debug" -> "Debug Workflow" -> "Always Use Disassembly" is disabled.
Does anyone face the same problem? Any ideas how to solve this? Thanks for any help.
Update: found out, that this happened because of macOS Sierra and not depends on Xcode version.
Recently found the solution. The issue was in workspace file (don't know, what exactly was wrong there). Solve it by creating new xcworkspace for the projects (I use different name, but I believe, there wasn't naming problem).

Error in conversion to swift 3 syntax for an existing cocoapods integrated project

I've recently upgraded to xcode 8 and did a conversion for my xcode project. While every other swift files checks out fine, there seems to be issues with this particular swift file.
I suspect it could be a result of cocoapods not being updated and thus I did a repo update to the latest pre version before doing a pod install on the project again but still to no avail.
Hmmm ok I found a way to fix this, apparently just going to product>clean will solve most of the problems. This is for anyone out there converting to swift 3. Now on to solve some other problems...

Alamofire Swift 2 - cannot submit for beta testing (Xcode 7 GM)

I have followed the instructions on installing the swift2 branch of Alamofire with cocoa pods. The app works well in the simulator, however, when I archive it for submission with Xcode 7 GM I receive an email with an error:
"The bundle contains an invalid implementation of Swift. The app may have been built or signed with non-compliant or pre-release tools"
This issue definitely relates to the framework as without it I am able to submit for beta testing with the same version of Xcode. I have tried turning bit code OFF in the build settings for Alamofire but it does not help.
Does anyone know how to fix this?
My podfile links only against Alamofire framework:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'swift-2.0'
One of the things that I found rather strange is that when I try to submit an archive I have the following screen:
Maybe this can be helpful in identifying the issue. The extra two targets are notification centre widgets. Disabling them doesn't resolve the issue. And without Alamofire I am able to submit for beta testing with both widgets attached.
Update
For those who are suggesting that "Swift 2.0 is in beta so you cannot submit" I want to clarify once more - I am trying to submit for beta testing. And YES, it is possible!
As I have indicated, I am able to submit for beta testing if I remove Alamofire and my own app is written in Swift 2.0. And if someone still thinks that "it is not possible" here is some info for you. Please read it first before posting comments or down voting question.
Update 2
This issue is still there with Xcode 7 GM...
OK, this issue is now fixed. I have tried the 2.0.1 version of Alamofire and I am able to submit with Xcode 7 GM and Bit Code turned ON for both Alamofire and my app.

Resources