1

For some reason, I am getting these 2 errors when I try to run my app.

error: make directory /Users/ameya/Library/Developer/Xcode/DerivedData/TennisTracker-gnfmqlprqnkoxbabnbcmuxgmrskv/Build/Products/Debug-iphonesimulator/TennisTracker.app/Watch/Tennis Tracker WK.app/_WatchKitStub: No such file or directory error: couldn't remove

'/Users/ameya/Library/Developer/Xcode/DerivedData/TennisTracker-gnfmqlprqnkoxbabnbcmuxgmrskv/Build/Products/Debug-iphonesimulator/TennisTracker.app/Watch/Tennis Tracker WK.app' after command failed: Directory not empty

I am relatively new to xcode and don't really have an idea about what this error means or how to fix it. I currently attempted to upgrade from WatchOs1 to Watchos2 by deleting my old files. I've already had some troubles trying to fully get rid of my old files and implementing the new ones. Is this in anyway related to the error that I am facing?

av993
  • 47
  • 4

1 Answers1

1

You have spaces in your watch app Project name.

This will lead to problems with file path, since the spaces aren't being escaped and the path isn't enclosed by double quotes.

  • For the first issue, the _WatchKitStub file couldn't be removed since the path wasn't escaped, so the file couldn't be found.

  • That triggered the second issue, when the now-quoted path couldn't be deleted (since the directory wasn't empty because the earlier command failed).

How to fix this issue:

You should create a new watch app target named TennisTrackerWK, change the target for your existing source files, then delete the old watch app target.

  • How can I change the target for my existing source files? – av993 Aug 02 '16 at 11:39
  • In the Utilities Pane, File Inspector, Target Membership. See [this answer](http://stackoverflow.com/a/5300901/4151918). In short, any file that had a checkmark for "Tennis Tracker WK" target membership should have a checkmark for "TennisTrackerWK." –  Aug 02 '16 at 12:48
  • mine was single word name but still this errors, any solution? – Tejas K Feb 12 '20 at 17:25