Xcode's Build and Archive not working
Asked Answered
I

11

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!

Imprecise answered 1/7, 2010 at 19:43 Comment(4)
Does it say what file is missing? Does "build and debug" with the otherwise exact same setup produce a working build?Wasteful
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.Imprecise
I hadn't tested it, but Build and Analyze works with my Debug settings, it's the Release profile that isn't working.Imprecise
For Xcode 4, this question looks into the issue: #5838909Fanaticism
M
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.

Mccubbin answered 15/7, 2010 at 1:59 Comment(2)
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!Imprecise
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.Graduated
F
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

Flaxseed answered 2/3, 2011 at 3:29 Comment(1)
This one worked for me. (Generate Debug Symbols was already enabled by default.)Tish
M
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.

Mccubbin answered 15/7, 2010 at 1:59 Comment(2)
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!Imprecise
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.Graduated
I
3

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

Ineluctable answered 8/6, 2011 at 14:8 Comment(0)
G
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

Graduated answered 14/7, 2010 at 20:3 Comment(1)
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.Imprecise
T
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.

Theorbo answered 2/6, 2011 at 16:34 Comment(1)
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.Dedication
L
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.

Leggat answered 14/7, 2010 at 5:50 Comment(1)
Nope :( The path is: Users/anauel/Desktop/AP/TG/iOSTG so there are no spaces or unusual characters.Imprecise
A
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.

Aubade answered 2/5, 2011 at 9:2 Comment(0)
U
1

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

Ulrikeulster answered 26/7, 2011 at 10:12 Comment(0)
C
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.

Careaga answered 10/7, 2010 at 22:22 Comment(1)
I currently have read and write permissions to the build folder.Imprecise
B
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.

Biome answered 13/7, 2010 at 0:27 Comment(3)
Yes, I've installed in developer. I basically formatted the drive because I installed an SSD and downloaded xCode from Apple.Imprecise
What's the path to the project? Any odd characters there?Biome
The path is: Users/anauel/Desktop/AP/TG/iOSTG so there are no spaces or unusual characters.Imprecise
P
0

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

Parodic answered 14/7, 2010 at 20:5 Comment(1)
Malcolmr just answered it. Thanks, though!Imprecise

© 2022 - 2024 — McMap. All rights reserved.