Sourcery: NSCocoaErrorDomain Code=4

I’m seeing an error whenever I try to generate files using Sourcery. The error looks like this:

error: Error Domain=NSCocoaErrorDomain Code=4 "“SwiftTemplate” couldn’t be moved to “Mock.swifttemplate” because either the former doesn’t exist, or the folder containing the latter doesn’t exist." UserInfo={NSSourceFilePathErrorKey=/var/folders/4s/kz_7_74j6y9dgr4zv1zty5w40000gn/T/SwiftTemplate/0.16.0/.build/debug/SwiftTemplate, NSUserStringVariant=(
    Move
), NSDestinationFilePath=/Users/max/Library/Caches/Sourcery/Mock.swifttemplate/68oTZ5uoc%2FNLqYRTuvHnzYxhRGfxDXdvwT7dDod7lWc%3D, NSFilePath=/var/folders/4s/kz_7_74j6y9dgr4zv1zty5w40000gn/T/SwiftTemplate/0.16.0/.build/debug/SwiftTemplate, NSUnderlyingError=0x7f80c04e5800 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

I’m seeing this error on Sourcery 0.16.0 as well as on the latest master branch. (I built the latter with Xcode 10.2). Running Mojave 10.14.4.

I see two other issues that look like they’re related, but both were closed without an apparent resolution. The suggestion to clean the ~/Library/Caches/Sourcery folder did not work for me.

Related issues: https://github.com/krzysztofzablocki/Sourcery/issues/739 https://github.com/krzysztofzablocki/Sourcery/issues/741

It also appears this PR (https://github.com/krzysztofzablocki/Sourcery/pull/744) was meant to fix the issue, but again I’m still seeing it on the latest master.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 23 (9 by maintainers)

Commits related to this issue

Most upvoted comments

I think this issue is actually what I described in #758, so once it’s merged this should be fixed (i.e. the proper error should be reported)

@krzysztofzablocki Here is the sample, sorry for delay. Please run pod install. The steps to reproduce the issue are described in the ReadMe.