Titanium Community Questions & Answer Archive

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

Mobil SDK 1.3.0 - TARGET_BUILD_DIR is incorrectly set.

Hello,

First lets get some technical details out of the way:

  • Snow Leopard 10.6.4
  • Titanium Developer 1.2.1
  • Titanium SDK 1.3.0
  • iOS SDK 3.2 or 4.0

( All with default settings)

The problem is that I can't build a project.

Starting with a fresh project, and testing in Simulator (initially under iOS 4.0, but the same problem occurs under iOS 3.2).

The full transcript can be seen here: http://pastie.org/1032332

But the final error is:


[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 /Users/jamesp/Documents/Titanium/Mo/build/iphone/build/Debug-iphonesimulator, was: /users/jamesp/Documents/Titanium/Mo/build/iphone/build/Debug-iphonesimulator

For some reason /users/ and /Users/ are considered to be different, can anyone suggest what is going wrong or how to fix it?

Jim

— asked July 6th 2010 by James Pearson
  • build
  • error
  • iphone
  • mobile
  • target_dir
4 Comments
  • Hi Jim, this happened to me again, and after hours of pain I managed to solve it.
    This worked for me:

    • Open you project in XCode, it's located in YOUR_PROJECT_DIR/build/iphone/YOUR_PROJ.xcodeproj

    • Pick Project -> Edit Project Settings from the top menu.

    • Pick the General tab at the top.

    • Here you should see some paths starting erroneously with "users" instead of "Users". Change these paths to use custom location and then change "users" to "Users" and recompile!

    I don't know where this variable comes from in the first place. If anyone can tell me how to change it globally, that would rock, cause I belive this fix has to be done for each project experiencing this problem.

    Cheers
    /Jacob

    — commented July 9th 2010 by Jacob Waller
  • Thanks Jacob - this finding unblocked me. In my case Users was users and my username which should be james was James. So it looks like they are making the wrong part of the path uppercase.
    James

    — commented July 11th 2010 by James Eddison
  • Hey Jacob,
    great job. thanks a lot for your post. I was really very tired solving this problem. Thanks again.

    — commented March 9th 2011 by Samavaya Samavaya
  • Hi all

    This solution no longer seems to work as I suspect you were all using Xcode 3. I've gone into the project, and looked at the settings, but I cna't see to find anything relating to the paths you are talking to. You can see a screen shot at http://imageshack.us/photo/my-images/41/xcodescreenshot.png/

    Can you shed some light on how to find this setting in Xcode 4 (assuming that is the problem)?

    — commented July 2nd 2011 by Matthew ORiordan

8 Answers

  • Accepted Answer

    I just had this problem. I resolved it by opening Xcode, going to Preferences, and changing the option for "Place Build Products in" to "Project directory". It resolved my problems immediately.

    — answered November 27th 2010 by Ian Maddox
    permalink
    5 Comments
    • I did this precise thing for someone today and it worked straight away - good call Ian.

      — commented March 31st 2011 by Kevin Whinnery
    • I expect this solution may have worked on an older version of XCode, but I am having this exact problem and have tried numerous things including going to Preferences and changing the option (under Locations in Preferences) for Build Location to "Place builds products in locations specified by targets". I still get the following error http://www.pastie.org/2154139.
      Strangely everything works fine if I build from Xcode directly.

      — commented July 2nd 2011 by Matthew ORiordan
    • same problem here, this solution does not work in Xcode 4.1
      building directly from Xcode seems to work.

      — commented October 8th 2011 by Bachir El Khoury
    • Thanks Ian. It worked for me.

      — commented December 17th 2011 by ansu jain
    • same problem for me as well. this solution didn't work in Xcode 4.2, OS X 10.6.8. what ended up working is

      1. dumping Xcode's preferences file: username/Library/Preferences/com.apple.dt.Xcode.plist, while Titanium is shut down,
      2. keeping the .plist open in Xcode and making sure it's mostly empty w/ no SYMROOT paths specified under IDEApplicationwideBuildSettings key (if IDEApplicationwideBuildSettings even exists in the .plist)
      3. without closing the .plist, launching Titanium and using it to run the simulator

      similar to what's described here: http://stackoverflow.com/questions/5582295/xcode-4-and-titanium-target-build-dir-is-incorrectly-set and by Jozef here: http://developer.appcelerator.com/question/117693/still-getting-your-targetbuilddir-is-incorrectly-set

      — commented October 18th 2012 by Tim Shayakhmetov
  • I had the very same problem just a minute ago, but relaunching worked for me. Or i started XCode, but I didn't do anything in it - maybe that helped somehow anyway?

    — answered July 6th 2010 by Jacob Waller
    permalink
    0 Comments
  • Case sensitive file systems see them as different folders.

    — answered July 6th 2010 by David Ashwood
    permalink
    0 Comments
  • @David

    Yes, that is the problem, but why is Titanium Developer using the 2 different versions of Users instead of sticking with 1 version?

    I haven't changed any settings, this is an out of the box problem.

    Jim

    — answered July 7th 2010 by James Pearson
    permalink
    2 Comments
    • In the Ti IDE, select your project and the Edit tab - at the top above the dialog boxes - do you see the path starting with /users or /Users?

      — commented July 7th 2010 by David Ashwood
    • Hi @David & @James

      When I go into Titanium Developer and go to Project Settings, all my paths use the upper case /Users/, however I still get the error about TARGET_BUILD_DIR being incorrectly set. See http://www.pastie.org/2154139

      Any suggestions?

      — commented July 2nd 2011 by Matthew ORiordan
  • For some reason I man suddenly getting this same issue to and I haven't even changed a thing.

    Everything was working fine a couple of days ago and now I'm getting the TARGET_BUILD_DIR error.

    Double you tee eff?

    — answered August 15th 2011 by Kosso
    permalink
    0 Comments
  • hi.. check my comments here: http://developer.appcelerator.com/question/119632/your-targetbuilddir-is-incorrectly-set. I believe an old SYMROOT value (from XCode3 project settings) is being picked up by the xcodebuild command line… my suggestion is that the Titanium team integrate the correct SYMROOT from the Ti project settings, by passing it to the command line. Can anyone else confirm this is the issue? thanks J

    — answered August 16th 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.