StuartB
StuartB

Reputation: 121

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

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.

Upvotes: 11

Views: 12573

Answers (9)

Adrenalinevictim
Adrenalinevictim

Reputation: 81

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.

Upvotes: 0

Idan Magled
Idan Magled

Reputation: 2216

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.

Upvotes: 0

Dan Wesnor
Dan Wesnor

Reputation: 677

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.

Upvotes: 0

CesareoAguirre
CesareoAguirre

Reputation: 1607

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

Upvotes: 0

RomanN
RomanN

Reputation: 2087

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

Upvotes: 13

MobileGeek
MobileGeek

Reputation: 2512

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

Upvotes: 2

Ben Baron
Ben Baron

Reputation: 14815

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.

Upvotes: 2

Saad
Saad

Reputation: 8947

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.

Upvotes: 2

jrtc27
jrtc27

Reputation: 8536

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).

Upvotes: 9

Related Questions