Xcode - error: unable to open executable.....how to fix?
Asked Answered
D

9

11

my first iPhone app is ready for submission using the Application Uploader. I think I understand that I have to create the file by going Product : Archive in Xcode, but when I do I get this message:

error: unable to open executable '/Users/Library/Developer/Xcode/DerivedData/test-euevazxsqeehnwantvxjhqwkytxr/ArchiveIntermediates/test/InstallationBuildProductsLocation/Applications/test.app/test'

The app builds and runs fine on my phone and on the simulator, so please can I have some advice on how to fix this? Thank you.

Drabbet answered 1/12, 2011 at 17:32 Comment(0)
S
13

You can also get this error if you've included .m file instead of the .h file somewhere in your code.

Selfsacrifice answered 20/9, 2012 at 14:25 Comment(1)
Wow. Right on point. Still wondering why Xcode doesn't have a check for this kind of stuff. Something should at least come up saying "Hey. You are including an .m file instead of a .h. This could be wrong."Guam
V
9

Product>Clean and Product>Clean Build Folder (hold down option for it to appear). Quit Xcode and reopen and all should be well. If not, go into the Organizer, choose Projects, find Test and delete its DerivedData folder (IMPORTANT: NOT SNAPSHOTS).

Vertu answered 1/12, 2011 at 17:56 Comment(8)
Thanks - I have done that but unfortunately it has not solved the issue. The app will not run in simulator now either, and I get these errors which I hope you can help with:ld: library not found for -lPhoneGapLib Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang failed with exit code 1Drabbet
Have you made sure that your iPhoneGapLib library ie being built before your application? Sounds to me like you have two targets - a library an the finished application.Vertu
I'm really sorry (and feeling somewhat out of my depth!) but I'm not sure what you mean - how do I make sure?Drabbet
Not to worry! How many targets do you have (go into the bar next to run and stop at the top and choose "Manage Schemes") and what are they called?Vertu
Product : Manage Schemes shows one scheme called: test. Is that what you need?Drabbet
Ok. I'm quite busy right now - do you mind if I continue with this in the evening (~8 hrs)?Vertu
i guess he got busy in the evening. Damn.Blane
This was quite a while ago... If you need help post a question yourself.Vertu
W
2

this error is due to some class level things when u name class and generates it's properties' getter setter with @synthesize. it generates methods with get and set names included with properties. Probably you have some class containing such names. The exact way to find out is to click your issue navigator in navigator box. and then click the error. read the green area. you will find out what you have. and now remove that class or what ever it is. create it again with some different name now. prblm will be solved.

Wicopy answered 14/12, 2011 at 8:33 Comment(0)
P
2

In my case, this turned out to be caused by an invalid library (specifically an old version of libz). Once I deleted that from my frameworks folder, and added the correct libz library in the build phases section of the target settings, it built as normal.

Pearcy answered 24/2, 2012 at 21:4 Comment(2)
I had something similar, had accidentally moved a library while trying to update it, so make sure to check your build phases tab!Trelu
+1 Same here. Was messing around with library paths and it messed up libGoogleAnalytics.a. Removed it and added it back - et voila!Jutta
S
2

You can get this type of error if your class' .m file is not listed under the "Compile Sources" step of the "Build Phases" tab of your target. Normally Xcode does this for you, but sometimes it loses the plot and you need to add the .m file manually.

like

Scintillate answered 26/8, 2012 at 13:5 Comment(0)
S
0

I had to dispose all linker flags in the main project (workspaces) and leave it only in the dependences.

//:configuration = Debug OTHER_LDFLAGS = -ObjC -M -all_load

//:configuration = Release OTHER_LDFLAGS = -ObjC -M -all_load

//:completeSettings = some OTHER_LDFLAGS

Serpens answered 30/1, 2013 at 21:45 Comment(0)
E
0

You'll get this error if any symbol is duplicated anywhere in the project. Most linkers issue a "duplicate symbol" error and tell you the name of the symbol and the file(s) it's have a problem with, but that isn't very Apple-like.

Lord knows what error they issue when the linker can't actually open the file.

Elohim answered 24/1, 2015 at 21:59 Comment(0)
A
0

Had the same problem today.

Xcode build path probably got a little crazy and lost the connection with my libGoogleAdMobAds.a or my libGoogleAnalyticsServices.a files.

Delete them import them back - fixed.

Hoped I helped.

Anabas answered 26/2, 2015 at 16:17 Comment(0)
T
0

I fixed it by adding x86_64 arm64 to VALID_ARCHS. Build Setting search "VALID_ARCHS",check the x86_64 arm645 is there or not, add and run.

Timepiece answered 31/1 at 11:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.