0rt
0rt

Reputation: 1365

How to fix Carthage the dependency graph contained a cycle?

I use Carthage in my project

Contents of Cartfile:

#socket.io-client
github "socketio/socket.io-client-swift" ~> 13.1.0

Contents of Cartfile.resolved

github "daltoniam/Starscream" "3.0.5"
github "socketio/socket.io-client-swift" "v13.1.3"

When I run carthage update --platform ios

I get the following output:
*** Fetching socket.io-client-swift
*** Fetching Starscream
*** Checking out socket.io-client-swift at "v13.1.3"
*** Checking out Starscream at "3.0.5"
*** xcodebuild output can be found in ...
The dependency graph contained a cycle:
socket.io-client-swift: Starscream
Starscream: zlib-spm, common-crypto-spm

My Carthage version is 0.29.0

Judging by the output there is no cycle in the dependencies

How can this be resolved?

Upvotes: 10

Views: 4466

Answers (3)

craft
craft

Reputation: 2135

When you edit Cartfile.resolved, carthage bootstrap can resolve the dependencies based on Cartfile.resolved.

carthage bootstrap vs update

carthage bootstrap command reads Cartfile.resolved and resolves your manual changes. This may be useful when you make a manual change like setting your repository to a local version for testing.

carthage update command reads the Cartfile and then updates Cartfile.resolved for you. This may be useful when you plan to make a version bump and plan to commit your change to Cartfile.

Upvotes: 0

blackjacx
blackjacx

Reputation: 10500

For me it helped to also remove Carthage's cache additionally to the Carthage folder:

$ rm -rf ./Carthage
$ rm -rf ~/Library/Caches/org.carthage.CarthageKit

Upvotes: 1

Darren
Darren

Reputation: 10398

I finally got it to build again by simply deleting the Carthage folder and running carthage update again

Upvotes: 21

Related Questions