Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 7, Swift 2.0, Carthage

After upgrading to Xcode 7.0, I convert all project to Swift 2.0. But I can't update Carthage libraries. I get this warning:

Failed to load plugin at: /Users/Alexandr/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CocoaPodUI.xcplugin, skipping. Reason for failure: *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]

And several errors:

Box/Box.swift:6:37: error: 'Printable' has been renamed to 'CustomStringConvertible' /Box/Box.swift:31:10: error: 'toString' has been renamed to 'String' Box/MutableBox.swift:8:51: error: 'Printable' has been renamed to 'CustomStringConvertible' Box/MutableBox.swift:25:10: error: 'toString' has been renamed to 'String'

How can I use Swift 2.0 version of frameworks? My carthage file looks like:

github "Alamofire/Alamofire" 
github "SwiftyJSON/SwiftyJSON" 
github "ReactiveCocoa/ReactiveCocoa"

Add "swift 2.0" in the end of framwork didn't work.

~ xcodebuild -version
Xcode 7.0
Build version 7A220
~ carthage version
0.9.1

Edit:

Seams Alamofire and SwiftyJSON already supports Swift 2.0. For ReactiveCocoa we need add branch "swift2".

github "Alamofire/Alamofire"
github "SwiftyJSON/SwiftyJSON"
github "ReactiveCocoa/ReactiveCocoa" "swift2"
like image 660
Gralex Avatar asked Oct 20 '22 02:10

Gralex


2 Answers

First of all what Cartage version do you have? run the command

Carthage version

The latest stable i think is 0.8.0 and I suggest you to upgrade it if you have an older version. To do so run

brew upgrade carthage

After that check that all libraries you are using supports Swift 2.0, if not check different branches from master, maybe they did not merge them yet.

I just saw you run 0.9.1, maybe it has problem? I'm using 0.8.0 and works fine with Alamofire

like image 97
r4id4 Avatar answered Nov 15 '22 04:11

r4id4


Worked for me by putting the following in my Cartfile:

github "ReactiveCocoa/ReactiveCocoa" >= 4.0

Currently v4.x of ReactiveCocoa is in alpha but v3.x does not support Swift 2

like image 22
jwswart Avatar answered Nov 15 '22 05:11

jwswart