Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Still getting "Your TARGET_BUILD_DIR is incorrectly set."

Before you bash me for not having read the forums already, I have. I've tried everything suggested, and then some. I even understand what's happening.

Xcode is trying to put the build folder in a custom location, which Titanium doesn't support.

I'm using Xcode 4 – which i've configured back to the defaults, and does build in the default location when projects are built in Xcode – but when built through Titanium, it'll use the custom build folder I set up in Xcode 3. Xcode 3 is no longer installed on my system.

So to try and fix the problem, I set Xcode 4 back to defaults. No fix. I deleted the Xcode plist file in Preferences. No fix. I completely uninstalled and reinstalled Xcode 4. No fix. I uninstalled Xcode 4 and reinstalled Xcode 3, confirming that it was set to use the default build folder. No fix. I deleted the iphone/build folder more times than I can count. No fix. I created a blank project and tried to build. Same problem.

But, if I go into the build/iphone folder and open up the Xcode project in Xcode 4 and build, it places files in the correct, default location.

Why does Titanium insist that Xcode is configured for a custom build location? How can I fix this?

— asked March 24th 2011 by Dan Schointuch
  • iphone
  • xcode
3 Comments
  • I have exactly the same problem. Here's my error

    [ERROR] Your TARGET_BUILD_DIR is incorrectly set. Most likely you have configured in Xcode a customized build location. Titanium does not currently support this configuration.
    [ERROR] Expected dir /Volumes/Data/_DEV/Projects/Titanium/test3/build/iphone/build/Debug-iphonesimulator, was: /Volumes/Data/_DEV/Projects/XCode/Build/Debug-iphonesimulator
    [ERROR] Error: Traceback (most recent call last):
      File "/Library/Application Support/Titanium/mobilesdk/osx/1.7.1/iphone/builder.py", line 1140, in main
        execute_xcode("iphonesimulator%s" % link_version,["GCC_PREPROCESSOR_DEFINITIONS=__LOG__ID__=%s DEPLOYTYPE=development TI_DEVELOPMENT=1 DEBUG=1 TI_VERSION=%s %s" % (log_id,sdk_version,debugstr)],False)
    

    now that second path is from an old setup, maybe when I was using XCode3, not even sure it was for Titanium apps, as I have my Cocos2d builds etc there also. As Dan says, I can build the project by opening it in Xcode4 though. Just not in Titanium Studio

    — commented July 16th 2011 by Józef Pierlejewski
  • seems like the Project/Target build settings are being set to the wrong value (but I dont know where it's getting that old value from)

    going into XCode and changing the Build Products Path to "build" instead of the incorrect "/Volumes/Data/_DEV/Projects/XCode/Build" allows mw to then build in Titanium Studio. I have to keep changing this for every new project though.

    — commented July 17th 2011 by Józef Pierlejewski
  • ok i found something related, but haven't got it working yet

    at the bottom of here:
    http://stackoverflow.com/questions/5599587/strange-behavior-of-xcode-build-products-path-under-build-locations

    > 1) Close all your projects in Xcode, but leave Xcode open
    > 2) Open up ~/Library/Preferences/com.apple.dt.Xcode.plist
    > 3) Find the key: IDEApplicationwideBuildSettings
    > 4) Delete the SYMROOT item in that key
    > 5) Save, restart Xcode
    > be careful w/ step two. the .dt. is for Xcode 4. without the dt is for Xcode 3.
    > This is almost certainly the result of Xcode migrating old preferences to 4 from 3.

    in the com.apple.Xcode.plist (XC3) that key is PBXApplicationwideBuildSettings

    the SYMROOT value in both of them is the value that Titanium is trying to put builds in and causing the mismatch with the project file location.

    whether that value is stored anywhere else I dont know

    — commented July 17th 2011 by Józef Pierlejewski

7 Answers

  • I've been having this problem and have my own workaround.

    For example, I get the following error:

    /Users/mark/Dropbox/Development/Titanium Studio Workspace/myProject/build/iphone/build/Debug-iphonesimulator, was: /Users/mark/Dropbox/development/Titanium Studio Workspace/myProject/build/iphone/build/Debug-iphonesimulator
    

    If I rename the "Development" folder to "development" and then back to "Development" the issue fixes itself.

    I've not figured out why it occurs but seems to happen quite a lot, and is always the same "Development" folder. I had originally thought it might be a Dropbox issue whilst it is sync'ing but don't think that's the reason now.

    Mark

    — answered June 25th 2011 by Mark Poston
    permalink
    2 Comments
    • I have intermittently experienced this over the last few months. This workaround works for me. Thanks.

      — commented July 17th 2011 by Rick White
    • After 4hrs trying to solve this problem, finally got it to work with your solution. Stupid dropbox!!!. Thank you for the fix

      — commented August 10th 2011 by Arian Caraballo
  • Yeah, I'm still getting the same problem as well – none of the fixes have worked yet. The core Library was updated 2 days ago, so I'm wondering if something new is afoot there.

    — answered March 26th 2011 by Tony Hoffman
    permalink
    0 Comments
  • I'm having the same problem. I've opened a helpdesk ticket, if I get a solution I'll post it here.

    — answered April 2nd 2011 by Itinerarium Itinerarium
    permalink
    1 Comment
    • Hi Itinerarium, did you get a solution?

      — commented July 2nd 2011 by Matthew ORiordan
  • I'm also suffering this - I can edit the xcode project and just change it and that is fine for the simulator but when trying to deploy to a iOS device it keep rebuilding the xcode project, finding this non-existant location and failing … what a nightmare. XCode is set to the default locations as well …

    — answered June 3rd 2011 by Craig Williams
    permalink
    0 Comments
  • Check that the name of the project in your tiapp.xml matches the XCode project name.

    tiapp.xml:

    <ti:app xmlns:ti="http://ti.appcelerator.org">
      ...
      <name>This-Name-Should-Match-Exactly</name>
      ...
    </ti:app>
    

    I had this problem when I tried to rename a project. I failed at the renaming and when I tried to revert back to the old name this error was occurring. Once I fixed the name discrepancy it stopped.

    If this does not work I would ensure that you do not have any special characters in the project name.

    Jason

    — answered June 3rd 2011 by Jason Harrelson
    permalink
    0 Comments
  • couldnt this be resolved by having Titanium pass the SYMROOT etc to the xcodebuild command line (see example here)

    — answered July 20th 2011 by Józef Pierlejewski
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.