7

The current issue I'm having is that Build and Archive will build my current target but after it's finished building, a pop-up will appear with the message:

"The operation couldn't be completed. No such file or directory"

I have reinstalled Xcode (3.2.3 with SDK 4.0), rebooted my machine, cleaned the cache, cleaned the project, manually deleted the project build directory. Nothing has worked.

I've also checked ~/Library/MobileDevice/Archived Applications and it is empty.

Any ideas?

p.s. This is driving me crazy!

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
olivaresF
  • 1,369
  • 2
  • 14
  • 28
  • 1
    Does it say what file is missing? Does "build and debug" with the otherwise exact same setup produce a working build? – Alex Wayne Jul 01 '10 at 22:46
  • Nope, that's all I get. Build and debug works both on the device and on the simulator with the exact same setup. All I'm doing differently is clicking build>build and archive instead of build>build and debug. – olivaresF Jul 01 '10 at 23:41
  • I hadn't tested it, but Build and Analyze works with my Debug settings, it's the Release profile that isn't working. – olivaresF Jul 01 '10 at 23:53
  • For Xcode 4, this question looks into the issue: http://stackoverflow.com/questions/5838409/xcode-4-archive-ipa-error-the-operation-couldnt-be-completed-no-such-file-or – ThomasW Jul 27 '11 at 04:14

11 Answers11

18

The error The operation couldn't be completed. No such file or directory also occurs in XCode 4.0 GM preview if you do not change identity to "Don't Re-sign" after selecting (Archives) Share in the Organizer

Mason Lee
  • 5,130
  • 1
  • 20
  • 15
6

I had this problem and the solution that was recommended to me was:

  1. Open your Xcode project
  2. Select Unity-iPhone in targets (Double click so it opens the info)
  3. Find "Generate Debug Symbols" and check it on. (Just Search for it in the search field)

This worked for me, but I still don't understand why it was necessary.

Malcolmr
  • 126
  • 1
  • Yes! This actually works. I have absolutely no idea why! If I try it without "Generate Debug Symbols" it gives me the warning, but once it's on, it works flawlessly. Thank you! – olivaresF Jul 15 '10 at 02:55
  • Nice find! You should probably report this as a bug to Apple. I think the build & archive trys to package the debug symbols along with the .app so that you can debug crash logs for your app using symbolicate. Their internal script may be expecting these symbols to be generated at all times, so possibly it fails when it can't find the generated symbols. – keno Jul 15 '10 at 04:15
3

All answers failed. Best solution, drag the .app bundle to iTunes and reveal the app in Finder. Boom! you get your ipa there.

Mugunth
  • 14,461
  • 15
  • 66
  • 94
2

Since it only seems to happen with your release configuration, double check the "Build Locations" values in your project settings for the release configuration.

  • Check the paths in the "build locations" to make sure they exist
  • Check the permissions for those paths
  • Try doing just a build (no archiving) for your release configuration

Also keep an eye on your build results window during the build to see if there were any warnings during the signing and packaging stages that could give you clues

keno
  • 2,956
  • 26
  • 39
  • I've checked and all those locations exist. The permissions seem to be okay. I've already just built the product using release as my configuration and it is working. It's just the build and archive feature that isn't. – olivaresF Jul 15 '10 at 02:49
2

Had the same issue and none of the mentions solutions worked. I finally found the problem when I tried to directly sign the app with the adhoc profile: it told me that I had twice a distribution profile in my keychain. I deleted the old one, then compiled again with the dev profile, and then archiving with the adhoc profile and it worked.

romrom
  • 642
  • 1
  • 6
  • 14
  • This was the solution that worked for me as well. "No such file or directory" appears to be a really generic error with many different possible causes. – RickDT Jun 03 '11 at 15:00
1

Longshot answer - do you have any unusual characters in your project path? This release note indicates it can cause problems:

While most known cases have been taken care of, having a space, comma, slash, backslash, tilde, or other character special to the Unix shell in the directory name of any parent folder of your project can cause your project build to fail in unexpected ways.

ergosys
  • 47,835
  • 5
  • 49
  • 70
1

If you have a 3:rd party SDK you need to add "$(SDKROOT)/ResourceRules.plist" to the “Code Signing Resource Rules Path” key in the targets build settings.

Magnus O.
  • 468
  • 5
  • 17
1

I solved this problem by exchanging the wildcard adhoc distribution profile I was using for an app specific adhoc distribution profile.

drct
  • 361
  • 4
  • 12
0

Of the top of my head, I would check permissions. Some code reports permissions problems as there being no file/folder. Check the Console log. You will sometimes find more info there.

TechZen
  • 64,370
  • 15
  • 118
  • 145
0

Did you install into /Developer? If you've customized that folder the issue could be that the path contains a space, which could be causing your problem.

Johan Kool
  • 15,637
  • 8
  • 64
  • 81
0

Run the Console app and see what information is being spit out there. That should give us more insight into the issue.

Marcus S. Zarra
  • 46,571
  • 9
  • 101
  • 182