I wonder if this is this due to APFS in High Sierra?
Here is something interesting ...
This may not be the issue but Iwas debugging an app with the entire project folder on <gasp> Dropbox (a cloud file sharing service). I think there was some hints below that the .debug file issue may be a timing thing. So, as a test, I moved my project to a local drive and the .debug file is deleted as it should be. The next debug session comes up without error this time.
So perhaps some odd timing or sharing nuance may be causing this? The failure was on the same system and the OS has been updated (macOS 10.13.1).
A word of warning when using "rm -r", always add code to verify that the path you intend to delete is exactly what you think it is. In the past I had a function go wrong and supply the wrong path to the rm -r function, there's no coming back!
when you see this occurring PLEASE open terminal and run
lsof +D <full path to the debug app bundle>
draggin the "debug" file into terminal should give you the right path
We do a low level unlink of the file (which is what rm calls to remove files) but if the file is busy this too can fail
Exactly. Xojo is the only Tool i can experience this behavior. Is there really nothing we/you can do to just being able to Build more than 1 time in a row without having to manually delete the Builds Folder? I mean, i can build and then instantly delete the whole Builds Folder manually and build right away again. But when i build and 5 minutes later try to build again without manually deleting the Builds Folder, this error happens.
Since we don't know why iconservicesagent, which seems to be a common culprit, is holding the file busy it’s really hard to know what, if anything, we could do to make this *not* happen. We can't kill the iconservicesagent - that would be really unwelcome behaviour on our part. And there's no api to request that it release it.
As for why manually deleting all that works vs the IDE trying to do it programmatically, I'm not sure. We are using the correct methods for removing the files and dirs but obviously with iconservicesagent holding it they fail. Google for iconservicesagent and you''ll find lots of people having issues with it in various ways and not just using Xojo.
As for "is there nothing we can do" I'd ask are you using 10.13? That *seems* to be the common thing among most people experiencing this. I know the engineers work on a variety of systems. Norms on 10.12.6 a lot and never has this issue there. Greg has been working a lot on 10.14 and, as far as I know, is also not having this problem.
Indeed isolating the "what" that causes this repeatedly among the people experiencing it would be awesome as that would help us figure out if it’s something Xojo needs to do differently or if it is just a bug in iconservicesagent that Apple needs to fix. However if it’s only in 10.13 it's unlikely Apple will fix it at this point but still - they might.