问题与标题中所述的一样。
我正在一个项目中,其中已经使用Carthage添加了一些依赖项,然后将这一行添加到了Cartfile
的末尾
github "socketio/socket.io-client-swift" ~> 15.2.0
这就是我的Cartfile
的样子
github "Rightpoint/Anchorage" ~> 4.2.1
github "Alamofire/Alamofire" ~> 4.7.3
github "danielgindi/Charts" ~> 3.2.1
github "auth0/Auth0.swift" ~> 1.15
github "auth0/SimpleKeychain"
github "socketio/socket.io-client-swift" ~> 15.2.0
因为我只想安装socketio,但保持其他依赖性不变,所以我运行了
$ carthage update socketio --platform iOS
No entry found for dependency socketio in Cartfile.
和
$ carthage update SocketIO --platform iOS
No entry found for dependency socketio in Cartfile.
我尝试了几次,但是安装过程无法启动。
这是我的解决方法,但我仍然想知道此问题的根本原因是什么。
Cartfile
和Cartfile.resolved
。 Cartfile
中的所有其他行,然后运行socketio
的行$ carthage update --platform iOS
socketio
已正确安装,这是从我的终端输出的>>
*** Fetching socket.io-client-swift *** Fetching Starscream *** Checking out Starscream at "3.1.1" *** Checking out socket.io-client-swift at "v15.2.0" *** No cache found for Starscream, building with all downstream dependencies *** xcodebuild output can be found in /var/folders/h7/yzvlp_9j6bqbs815ntdby5tc0000gn/T/carthage-xcodebuild.lv98cm.log *** Building scheme "Starscream" in Starscream.xcodeproj *** Building scheme "SocketIO" in Socket.IO-Client-Swift.xcodeproj
然后,您需要合并
Cartfile
和Cartfile.resolved
的新旧版本,以合并由新依赖项(即SocketIO和Starscream)添加的相关行。 (如果您感到困惑,请打开这两个文件)