Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some dependencies¹ NSCocoaErrorDomain Code=260 with archive builds · ⑴ Possibly AFNetworking, possibly constrained to versions around v3.1.0 #2277

Closed
gaofengwh opened this issue Dec 4, 2017 · 37 comments
Labels

Comments

@gaofengwh
Copy link

  • carthage version: 0.26.2
  • xcodebuild -version: Xcode 9.1 Build version 9B55
  • Are you using --no-build? yes
  • Are you using --no-use-binaries? no
carthage update --no-use-binaries
*** Fetching AFNetworking
*** Checking out AFNetworking at "3.1.0"
*** xcodebuild output can be found in /var/folders/_0/8yz75xc560j4_y5l6nljr_7r0000gn/T/carthage-xcodebuild.IyOaSI.log
*** Building scheme "AFNetworking iOS" in AFNetworking.xcworkspace
Failed to write to /Users/gaofeng/Desktop/TestCarthage/Carthage/Build/iOS/AFNetworking.framework: Error Domain=NSCocoaErrorDomain Code=260 "The file “AFNetworking.framework” couldn’t be opened because there is no such file." UserInfo={NSURL=file:///Users/gaofeng/Desktop/TestCarthage/Carthage/Checkouts/AFNetworking/build/ArchiveIntermediates/AFNetworking%20iOS/BuildProductsPath/Release-iphoneos/AFNetworking.framework, NSFilePath=/Users/gaofeng/Desktop/TestCarthage/Carthage/Checkouts/AFNetworking/build/ArchiveIntermediates/AFNetworking iOS/BuildProductsPath/Release-iphoneos/AFNetworking.framework, NSUnderlyingError=0x7f99fc64d130 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
  • Are you using --use-submodules?
gaofeng:TestCarthage gaofeng$ carthage update  --use-submodules
*** Fetching AFNetworking
*** Checking out AFNetworking at "3.1.0"
A shell task (/usr/bin/env git submodule --quiet sync --recursive (launched in /Users/gaofeng/Desktop/TestCarthage)) failed with exit code 128:
fatal: Not a git repository (or any of the parent directories): .git
  • Are you using --cache-builds?
gaofeng:TestCarthage gaofeng$ carthage update  --cache-builds
*** Fetching AFNetworking
*** Downloading AFNetworking.framework binary at "3.1.0"
*** Checking out AFNetworking at "3.1.0"
*** No cache found for AFNetworking, building with all downstream dependencies
*** xcodebuild output can be found in /var/folders/_0/8yz75xc560j4_y5l6nljr_7r0000gn/T/carthage-xcodebuild.Oushrr.log
*** Building scheme "AFNetworking OS X" in AFNetworking.xcworkspace
Failed to write to /Users/gaofeng/Desktop/TestCarthage/Carthage/Build/Mac/AFNetworking.framework: Error Domain=NSCocoaErrorDomain Code=260 "The file “AFNetworking.framework” couldn’t be opened because there is no such file." UserInfo={NSURL=file:///Users/gaofeng/Desktop/TestCarthage/Carthage/Checkouts/AFNetworking/build/ArchiveIntermediates/AFNetworking%20OS%20X/BuildProductsPath/Release/AFNetworking.framework, NSFilePath=/Users/gaofeng/Desktop/TestCarthage/Carthage/Checkouts/AFNetworking/build/ArchiveIntermediates/AFNetworking OS X/BuildProductsPath/Release/AFNetworking.framework, NSUnderlyingError=0x7fc658720fd0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

Cartfile

github "AFNetworking/AFNetworking"

Carthage Output

Failed to write to /Users/gaofeng/Desktop/TestCarthage/Carthage/Build/Mac/AFNetworking.framework: Error Domain=NSCocoaErrorDomain Code=260 "The file “AFNetworking.framework” couldn’t be opened because there is no such file." UserInfo={NSURL=file:///Users/gaofeng/Desktop/TestCarthage/Carthage/Checkouts/AFNetworking/build/ArchiveIntermediates/AFNetworking%20OS%20X/BuildProductsPath/Release/AFNetworking.framework, NSFilePath=/Users/gaofeng/Desktop/TestCarthage/Carthage/Checkouts/AFNetworking/build/ArchiveIntermediates/AFNetworking OS X/BuildProductsPath/Release/AFNetworking.framework, NSUnderlyingError=0x7fc658720fd0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
@peres
Copy link

peres commented Jan 25, 2018

Did you solve your problem? I'm having it with AFNetworking, too, in Carthage 0.27.

@nomadplanet
Copy link

I personally had to switch back to carthage 0.24 to «fix» the issue

@mdiep
Copy link
Member

mdiep commented Feb 1, 2018

I think this is related to Carthage's use of xcodebuild archive.

@c0diq
Copy link

c0diq commented Feb 15, 2018

Same problem here.

@ikesyo
Copy link
Member

ikesyo commented Feb 16, 2018

This may be a duplicate of #2220.

@maddanio
Copy link

anything we can do? this blocks our builds...:(

@ikesyo
Copy link
Member

ikesyo commented Mar 19, 2018

Please make it sure that you don’t have SYMROOT build setting as described in #2220 (comment).

@maddanio
Copy link

the cartfile is super simple:
github "AFNetworking/AFNetworking" ~> 3.1
github "swisspol/GCDWebServer" ~> 3.2.5
github "SVProgressHUD/SVProgressHUD"
and then we just run carthage bootstrap --platform iOS

@maddanio
Copy link

ah, you mean in AFNetworking itself?

@maddanio
Copy link

i cannot find any symroot settings in afnetworking. also switching to 3.2 did not help.

@tmspzz
Copy link
Member

tmspzz commented Mar 19, 2018

I just tried with the Cartfile you have indicated and I'm not seeing the issue. Try removing your Cartfile.resolved @maddanio

carthage 0.28.0
Xcode 9.2

@maddanio
Copy link

no dice :(. removed the resolved file, deleted Carthage folder. same versions of XCode and carthage. The latter installed via homebrew. osx is 10.12.6 (sierra).

@tmspzz
Copy link
Member

tmspzz commented Mar 19, 2018

Can you share a zip of a test project where this happens?

@maddanio
Copy link

Will do this afternoon. So you mean the Carthage dir after the failure?

@maddanio
Copy link

ok, i looked at the file system vs the error message. the error is:

Failed to write to /Users/daniel/Documents/git/game-on-ios/dependencies/Carthage/Build/iOS/AFNetworking.framework: Error Domain=NSCocoaErrorDomain Code=260 "The file “AFNetworking.framework” couldn’t be opened because there is no such file." UserInfo={NSURL=file:///Users/daniel/Documents/git/game-on-ios/dependencies/Carthage/Checkouts/AFNetworking/build/ArchiveIntermediates/AFNetworking%20iOS/BuildProductsPath/Release-iphoneos/AFNetworking.framework, NSFilePath=/Users/daniel/Documents/git/game-on-ios/dependencies/Carthage/Checkouts/AFNetworking/build/ArchiveIntermediates/AFNetworking iOS/BuildProductsPath/Release-iphoneos/AFNetworking.framework, NSUnderlyingError=0x7fbf73d78d90 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

and indeed, the folder Carthage/Checkouts/AFNetworking/build/ArchiveIntermediates does not exist. that build folder only contains the directories AFNetworking.build and Release-iphonesimulator.
also i grepped for "ArchiveIntermediates" and cannot find it mentioned anywhere, so I am not sure why it assumes it exists.

@AlessandroMulloni
Copy link

AlessandroMulloni commented Mar 30, 2018

Also seeing this issue, with Xcode 9.3 and Carthage 0.29.0.
No matter which project is in my Cartfile, I always end up with the same error where the file is looked for in the /.../ArchiveIntermediates/... folder.

Only reverting to Carthage 0.24.0 fixes the issue for me, any newer version is not working.

As the issue is not repeatable on some machine, it must be related to some local machine settings on my machine as well as @maddanio 's. I will report any finding.

@AlessandroMulloni
Copy link

I just found a fix for this issue, it is a rather hidden XCode setting. Please refer to my latest comment on the thread here: #2220

Feel free to validate and close this issue.

@maddanio
Copy link

So what do i do? Can Carthage fix it? Or does, in my case, AFNetworking need to do this?

@jdhealy
Copy link
Member

jdhealy commented Mar 30, 2018

@maddanio I'm curious as to why @blender wasn’t able to reproduce the issue, and the answer may be attainable from the build settings from an AFNetworking build on your machine.

For you to grab those build settings would require cautiously making and reverting some changes to ~/Library/Preferences/com.apple.dt.Xcode.plist, and then cautiously redacting some environment variables (which all get output) from the carthage output. (Wish there was a better way…)

If you're okay with that, the instructions are below:

Instructions to Cautiously Follow, Remembering to Make Redactions on Output
  1. Quit Xcode.
  2. cd /Users/daniel/Documents/git/game-on-ios && ditto ~/Library/Preferences/com.apple.dt.Xcode.plist /var/tmp && defaults write com.apple.dt.xcode BuildSettingsLogLevel -int 3 && defaults write com.apple.dt.xcode BuildSettingExpansionLogLevel -int 3 && defaults write com.apple.dt.xcode BuildLogLevel -int 3 && killall -u $USER cfprefsd
  3. carthage … --verbose
  4. copy the output
  5. inspect closely and make redactions — ⚠️ your environment variables will all be in that output, so tread carefully
  6. upload it as a gist
  7. post the gist here
    • cd /Users/daniel/Documents/git/game-on-ios && defaults write com.apple.dt.xcode BuildSettingsLogLevel -int 1 && defaults write com.apple.dt.xcode BuildSettingExpansionLogLevel -int 1 && defaults write com.apple.dt.xcode BuildLogLevel -int 1 && killall -u $USER cfprefsd
    • or — preferably, but more cautiously — quit Xcode → overwrite ~/Library/Preferences/com.apple.dt.Xcode.plist with /var/tmp/com.apple.dt.Xcode.plistkillall -u $USER cfprefsd and hope for the best

@jdhealy jdhealy changed the title Failed to write to AFNetworking¹ NSCocoaErrorDomain Code=260 with archive builds · ⑴ Possibly, constrained to versions around v3.1.0 Mar 30, 2018
@AlessandroMulloni
Copy link

@maddanio apologies if my comment was misleading. The issue you mentioned was happening for me for every Carthage package, not just for AFNetworking. In that case I had to fix my local build setup.

If you remove AFNetworking do GCDWebServer and SVProgressHUD compile fine?

@maddanio
Copy link

maddanio commented Mar 31, 2018 via email

@maddanio
Copy link

maddanio commented Mar 31, 2018 via email

@AlessandroMulloni
Copy link

@maddanio I did nothing either, still the setting was set to "Legacy" when I went checking. Maybe it's some setting that was kept from an older XCode version, I also use the beta versions every now and then. I honestly do not know why it was not set to the default.

@kas-kad
Copy link
Contributor

kas-kad commented Jun 13, 2018

having the same issue on 0.29.0, Xcode 9.4, blank new project. The resolution of #2220 doesn't help. Only switching back to 0.25.0 helps.

@jdhealy jdhealy changed the title AFNetworking¹ NSCocoaErrorDomain Code=260 with archive builds · ⑴ Possibly, constrained to versions around v3.1.0 Some dependencies¹ NSCocoaErrorDomain Code=260 with archive builds · ⑴ Possibly AFNetworking, possibly constrained to versions around v3.1.0 Jul 11, 2018
@jdhealy
Copy link
Member

jdhealy commented Jul 11, 2018

@kas-kad, would you be willing to (cautiously) share your build settings? (If you’re using Xcode’s legacy build system, otherwise those instructions aren’t applicable.)

That would help us greatly in diagnosing and reproducing the issue.

@kas-kad
Copy link
Contributor

kas-kad commented Jul 15, 2018

@jdhealy I reproduced the issue on Carthage 0.30.1. Here are the logs https://gist.github.com/kas-kad/beefae3c83fa060db0cbe39b0f9e3510/raw/4717f84d5320bd4c355292f5ab434be4b70abdcc/gistfile1.txt
please note that it's different library installing via Carthage, not AFNetworking, but the error message is the same.

@jdhealy
Copy link
Member

jdhealy commented Jul 15, 2018

@kas-kad infobip/mobile-messaging-sdk-ios has SYMROOT set (here and here).

See @ikesyo’s comment: #2277 (comment)

I was able to build correctly with Carthage v0.29.0 after removing those lines, cd-ing to it’s directory, and running carthage build --no-skip-current --verbose.


When you mentioned “blank new project”: was that a framework that you created where you saw the NSCocoaErrorDomain Code=260 error output when it was added to a Cartfile?

@kas-kad
Copy link
Contributor

kas-kad commented Jul 16, 2018

@jdhealy removing SYMROOT setting helped me. Thanks!

@stale
Copy link

stale bot commented Aug 15, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 15, 2018
@stale stale bot closed this as completed Aug 22, 2018
@maddanio
Copy link

am i the only one? now (osx 10.13.6, XCode 10.0) it happens on every package.

@maddanio
Copy link

ah, got it, it was the derived data legacy setting. can anyone explain to me what that derived data actually is?

@bsabiston
Copy link

So is there an easy answer to this problem? I am unable to update my Dropbox SDK via Carthage because of this error. @maddanio what did you have to do to get it to work?

@jdhealy
Copy link
Member

jdhealy commented Nov 23, 2018

@bsabiston, did you read through @AlessandroMulloni’s resolution to this from #2220 mentioned above?

@bsabiston
Copy link

bsabiston commented Nov 23, 2018

@jdhealy I see that, but my Derived Data build location is already set to 'Unique' ...

@maddanio
Copy link

Clearing Xcode State is the one usually

@maddanio
Copy link

Can we all agree that a (badly done) globally strateful buildsystem is a bad idea?

@zhouyuanbo
Copy link

@bsabiston Update to the latest Carthage version: 0.31.2. It worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests