79

Regardless of build configuration, building my iPad app does not actually output a .app file. It does run in the iPad simulator and on a device, but when I hit build or build and run, the binary appears under Products in red and is not created in the "build" folder as designated in build settings.

Any ideas?

GendoIkari
  • 11,734
  • 6
  • 62
  • 104
Tiki
  • 1,206
  • 1
  • 13
  • 17
  • Found an answer in http://stackoverflow.com/questions/6256218/ios-static-library-product-is-always-red: It's an Xcode bug. Build for device and they'll appear. – Jon Reid Apr 25 '12 at 20:47

3 Answers3

131

Xcode 4 places its build products and other intermediaries/temporary files/indexes in a derived data directory now instead of a "build" directory that is mixed in with your product files. It does this to deal with the new workspaces and also so that you can have clean builds of different projects in different workspaces without contaminating each other.

If your original template was old, your built product is probably relative to your source directory instead of relative to your built products directory, which is why it's showing up red. By default, your derived data directory will be under ~/Library/Developer/Xcode/DerivedData. To see where your current workspace/project is placing these files, you can File->Workspace Settings... and take a look at the Build Location.

Jason Coco
  • 77,985
  • 20
  • 184
  • 180
  • Thanks! I opened Project Settings and set the build products to be placed in the configuration-specified location. – Tiki Mar 16 '11 at 20:48
  • Thanks for explaining the reason why this change was made...makes sense now. – toofah Mar 25 '11 at 22:47
  • 5
    Should it be *File->Project Settings* now? – Ross Apr 08 '11 at 17:18
  • 9
    @Ross - it's *File->Project Settings* when you have a single project window open, and *File->Workspace Settings* when you have a workspace window open. Whichever menu entry you have, however, it's in the same location and it has the same actual options... – Jason Coco Apr 09 '11 at 04:43
  • 2
    Even with new templates, the products show up red. What should I set the "Derived Data Location" to? – ma11hew28 Aug 01 '11 at 07:19
2

I was having this problem. not only the product .app was red, also simulator wasn't loaded the binary, it was stuck in attaching 'my app'. i solved it by going to file->project settings. in the tab 'build' changed derived data location to 'project-relative', and in advanced changed build location to 'locations specified by targets'. with the default options it wasn't possible to run the app, i'm not sure why.

Alexander Fradiani
  • 1,001
  • 3
  • 13
  • 33
1

To resolve the issue in XCode 4.x go through following steps :-

Open your project in XCode.

Select .xcodeproj file in XCode project Navigator.

Select the target under the PROJECT Heading. (i.e. the top most target, this target specify your project level build settings)

Now navigate to Build Settings.

Now search for option "Per-Configuration Build Products Path" and update it's value to $(SYMROOT) .

Anshul Sharma
  • 166
  • 1
  • 5