Failing to integrate or create new Cake
Thanks for putting this together!
We're running into issues with both creating a new Cake project and integrating an existing project with Cake. We get this message when integrating or opening a Xcode (Beta 4):
Possibly related. When trying to build, we get this error:
The operation couldn’t be completed. (E.notCake(Path.Path(string: "{ path to the project }")))
Maybe we're doing something wrong? Tried on multiple machines and tinkered with some different build settings. No luck:/
Can you tell me more about the project? Is it a regular project? Or a workspace?
Both. We started trying with our workspace. When that didn't work I make a new regular project and attempted integrating. Then tried creating a project through cake. All with the same results.
Funny “New Cake” doesn't work either, this is pretty much a static operation without much configuration.
I just tested both locally and it worked FYI. Must be something about your configuration I didn't expect.
Cake version?
1.0.3 with Xcode 10.2 beta 4
Every time Cake runs I get the NSCocoaErrorDomain.3587 error dialog
Are there any other steps or any environment tools/configurations I might be missing?
Stepping through the Cake code now. Haven't figured out anything yet
Any info here? https://github.com/mxcl/Cake/issues/49
We thought that one fixed, but could be that it's not.
Here’s the main notCake throw (there's one other, but it's the same cause)
https://github.com/mxcl/Cake/blob/4f61b7567d45ab865bf4e5a743c75a1026d4dfdc/Sources/Model/Base/XcodeProject/XcakeProject/Processor/Kitchen/CakeProject.swift#L40
Seems unlikely there'd no Cakefile though. Could be other causes though for that throw.
Which comes from here:
https://github.com/mxcl/Cake/blob/4f61b7567d45ab865bf4e5a743c75a1026d4dfdc/Sources/Model/Base/XcodeProject/XcakeProject/Processor/Cakefile.swift#L34
When first running Cake or creating a new project. This is the first place I hit E.notCake.
https://github.com/mxcl/Cake/blob/43624666bbf41e9ac4bcc4c6d79af3c08b2f5981/Sources/Model/Base/XcodeProject/XcakeProject/Processor/Kitchen/Kitchen.swift#L84-L87
I hit the E.notCake catch and the NSCocoaErrorDomain.3587 dialog kicks off.
paths from diff.added = [
"/Users/Developer/Cake/Cake.xcodeproj"
"/Users/Desktop/Bread Pudding/Bread Pudding.xcodeproj"
]
xcodePath = "/Applications/Xcode-beta.app"
Toolkit
▿ cakePath : Path
- string : "/Users/Developer/Cake/DerivedData/Cake/Build/Products/Debug/Cake.app"
▿ xcodePath : Path
- string : "/Applications/Xcode-beta.app"
▿ cakeVersion : 1.0.3-debug
- major : 1
- minor : 0
- patch : 3
▿ prereleaseIdentifiers : 1 element
- 0 : "debug"
- buildMetadataIdentifiers : 0 elements
- xcodeProductBuildVersion : "10P107d"
Nothing stands out to me as to why this is catching on line 84.
Later on, when I build the Bread Pudding project (second path above). I get the E.notCake error from:
https://github.com/mxcl/Cake/blob/43624666bbf41e9ac4bcc4c6d79af3c08b2f5981/Sources/Model/Base/XcodeProject/XcakeProject/Processor/Kitchen/Kitchen.swift#L45-L51
because cakes is empty.
Hello, I haven't looked into this well but when i also selected command line tools as beta the errors went away.
sudo xcode-select -s /Applications/Xcode-beta.app
I tried that pretty early on, but got the same results. In my test above you can see the xcodePath variable is pointing to that location.
xcode-select -p prints /Applications/Xcode-beta.app/Contents/Developer
We were able to get pass this problem with these troubleshooting steps. Some are in the guide, but not all.
swift -v swiftc -v should both print version 5.0
xcode-select -p prints /Applications/Xcode-beta.app/Contents/Developer
If not, use sudo xcode-select -s /Applications/Xcode-beta.appor wherever your Xcode 10.2+ is located.
Make sure you clear derived data. The Cake menubar item rm -rf 'Derived Data' closes Xcode and clears it. Or at least it should. You can manually delete it at /Users/{user}/Library/Developer/Xcode/DerivedData if you write at the default location, which leads me to my next point.
I found my derived data was being written to a relative path instead of the Xcode default path. Which I believe was part of my problem. Check this at option Preferences > Locations > Derived Data. I changed this setting back to Default.
At this point I was able to get the Cake to work from Xcode but not from the release version 1.0.3.
I uninstalled Cake and deleted the Cake directory found at /Users/{user}/Library/Developer/Cake
After reinstalling, opening cake, deleting Xcode derived data one more time. Things seemed to work.
Not entirely sure what happened to cause this. I'm underwhelmed with this solution. When all else fails, turn it off and back on again.
Reopening. I think I probably hardcode the derives data path someplace. Not that this should matter.
Same problem here: I installed Cake 1.0.3, created an iOS "New Cake" project, and got this same error as @kaydenthomson "The operation couldn’t be completed. (NSCocoaErrorDomain.3587)".
Also when I build the application I also get the same error "error: The operation couldn’t be completed. (E.notCake(Path.Path(string: "/Users/mac/Desktop/Bûche de Noël"))) notice: { }"
I removed the derived data, no effect Tried with Xcode 10.2 or 10.2 beta, no effect Tried to select the other Xcode version with xcode-select, no effect I switched to Swift 5.0 with SwiftEnv, and created again a new Cake projet, no effect
Any other suggestion ?
I also tried to remove the Cake directory (/Users/{user}/Library/Developer/Cake) and reinstall it, also no effect
Sorry about these problems. I cannot reproduce locally.
The workaround is ensuring the Xcode 10.2 command line tools are installed, perhaps, does that help?
Don't worry and thanks for your answer and for your work @mxcl :) I don't have access right now but the command line tools should probably be installed. I will have more time to investigate tomorrow