Carthage: Getting error in Carthage Update

Created on 27 Oct 2015  Â·  10Comments  Â·  Source: Carthage/Carthage

Hi, I'm using ReactiveCocoa with Carthage in My project. On first time, update Carthage is working well but after that time, when I update carthage, I'm getting this error.

Failed to write to /Users/PROJECT_PATH/iOS/Carthage/Build/iOS/ReactiveCocoa.framework: Error Domain=NSCocoaErrorDomain Code=516 "“ReactiveCocoa.framework” couldn’t be copied to “iOS” because an item with the same name already exists." UserInfo={NSSourceFilePathErrorKey=/private/var/folders/nh/86ht70nn0t7bbg3q361gs_6m0000gp/T/carthage-archive.BLEwNt/Carthage/Build/iOS/ReactiveCocoa.framework, NSUserStringVariant=(
Copy
), NSDestinationFilePath=/Users/PROJECT_PATH/iOS/Carthage/Build/iOS/ReactiveCocoa.framework, NSFilePath=/private/var/folders/nh/86ht70nn0t7bbg3q361gs_6m0000gp/T/carthage-archive.BLEwNt/Carthage/Build/iOS/ReactiveCocoa.framework, NSUnderlyingError=0x7feb60c272a0 {Error Domain=NSPOSIXErrorDomain Code=17 "File exists"}}

In Cartfile

github "ReactiveCocoa/ReactiveCocoa" >= 4.0

And update carthage

carthage update --platform iOS

I'm using Xcode 7.1 with Swift 2.0

All 10 comments

Whats in your Cartfile.resolved? I wouldn't expect the >= 4.0 version specifier to work because RAC hasn't released an actual 4.0 yet. It only has alpha builds, which Carthage won't pick up unless you explicitly specify them.

In <Cartfile.resolved>, following version shows.

github "antitypical/Result" "0.6.0-beta.5"
github "ReactiveCocoa/ReactiveCocoa" "v4.0.0-alpha.3"

I can reproduce this too. In a clean directory with only a Cartfile:

± % carthage update
*** Fetching CocoaLumberjack
*** Downloading CocoaLumberjack at "tvOS, Xcode 7.1"
Failed to write to /Users/me/lab/ios/Carthage/Build/iOS/CocoaLumberjack.framework: Error Domain=NSCocoaErrorDomain Code=513 "“CocoaLumberjack.framework” couldn’t be removed because you don’t have permission to access it." UserInfo={NSFilePath=/Users/me/lab/ios/Carthage/Build/iOS/CocoaLumberjack.framework, NSUserStringVariant=(
    Remove
), NSUnderlyingError=0x7fdde37357c0 {Error Domain=NSPOSIXErrorDomain Code=66 "Directory not empty"}}
github "CocoaLumberjack/CocoaLumberjack" == 2.2.0

I just fixed this error by updating carthage with brew.

I believe this was fixed in 0.9.2 with #760. You can install 0.10 by homebrew now.

I am having carthage 0.18 and still having this issue sometimes

I am seeing this issue in latest release .20

I'm having this issue also since .20 using carthage update --cache-builds

Failed to write to /MY_SRC_PATH/Carthage/Checkouts/MY_LIB_A/Carthage/Checkouts/MY_LIB_B: Error Domain=NSCocoaErrorDomain Code=516 "The file “MY_LIB_B” couldn’t be saved in the folder “Checkouts” because a file with the same name already exists." UserInfo={NSFilePath= /MY_SRC_PATH/Carthage/Checkouts/MY_LIB_A/Carthage/Checkouts/MY_LIB_B, NSUnderlyingError=0x7feee1542820 {Error Domain=NSPOSIXErrorDomain Code=17 "File exists"}}

It seems to happens with dependencies of my frameworks, that are also dependencies of my project

|-- MY_LIB_B
|-- MY_LIB_A
|   +-- MY_LIB_B

Quick Update, a mate is having the same trouble with a dependency of a dependency.

In her case, the parent project is not using the conflictive framework.

Oops. I see that is the same issue than #1794

Was this page helpful?
0 / 5 - 0 ratings