在Cartfile中未找到依赖项socketio的条目

问题描述 投票:0回答:1

问题与标题中所述的一样。

我正在一个项目中,其中已经使用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.

我尝试了几次,但是安装过程无法启动。

ios swift websocket socket.io carthage
1个回答
0
投票

这是我的解决方法,但我仍然想知道此问题的根本原因是什么。

  • 同时复制CartfileCartfile.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

然后,您需要合并CartfileCartfile.resolved的新旧版本,以合并由新依赖项(即SocketIO和Starscream)添加的相关行。 (如果您感到困惑,请打开这两个文件)

© www.soinside.com 2019 - 2024. All rights reserved.