Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3108] Your TARGET_BUILD_DIR is incorrectly set : Cannot set build/iphone/build path

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-02-21T14:22:53.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelstc-more-info
ReporterMichael White
AssigneeMauro Parra-Miranda
Created2012-01-01T16:42:20.000+0000
Updated2016-03-08T07:48:09.000+0000

Description

Problem

Launching newly created project in iOS simulator produces following exception:
+ TARGET_BUILD_DIR = /Users/mwhite/Documents/Titanium Studio Workspace/com.zytac.tit2/build/iphone/Debug-iphonesimulator

Exception detected in script:
Traceback (most recent call last):
  File "/Users/mwhite/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1/iphone/builder.py", line 1274, 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 %s" % (log_id,sdk_version,debugstr,kroll_coverage)],False)
  File "/Users/mwhite/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1/iphone/builder.py", line 1202, in execute_xcode
    sys.exit(1)
SystemExit: 1
If you check the build.py script there is a test at line 1197. xcode will not be invoked if the test fails. I can see from the code that TARGET_BUILD_DIR must be equal to build_dir. HOWEVER in xcode 4.2 I have no idea how to correct TARGET_BUILD_DIR (ENV). The difference can clearly be seen mid string at ".....project/iphone/project....". It would help if the source of TARGET_BUILD_DIR was documented. Looking at the contents of this string it can only come from Titanium since Xcode can only obtain this string from the .xcodeproj file which is created by Titanium.

Test case

Steps to reproduce: * create a new "Titanium mobile project" in Titanium studio. Use Xcode 4.2.1 * do not add any new code to the project * build the project using "iPhone Simulator"

Workaround

* Open the .xcodeproj file created by Titanium Studio by invoking the Xcode GUI. The compiled project can then be run using Xcode outside of Titanium.

Discussions

http://developer.appcelerator.com/question/117950/error-your-targetbuilddir-is-incorrectly-set http://developer.appcelerator.com/question/71331/really-thats-the-first-impression#answer-218760

Attachments

FileDateSize
build.log2012-01-02T03:47:55.000+000051488

Comments

  1. Paul Dowsett 2012-01-01

    Michael Have you read [How to Submit a Bug Report](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report)? If so, where is the link to the Q&A question you raised? Where is a link to the workaround you mention? Where is your log file? Once the necessary information is included, I can see if we can escalate this issue. Thanks
  2. Michael White 2012-01-02

    http://developer.appcelerator.com/question/117950/error-your-targetbuilddir-is-incorrectly-set http://developer.appcelerator.com/question/71331/really-thats-the-first-impression#answer-218760
  3. Paul Dowsett 2012-01-02

    Michael See ticket TIMOB-2588, which provides a possible solution. If this does not work, then we need to know the steps required in order to reproduce the issue, to be able to accept this ticket. Thank you
  4. Paul Dowsett 2012-01-02

    btw, it's preferable that you edit the ticket to add missing information, rather than to add it in a comment. Please also try to use the [JIRA Ticket Template](https://wiki.appcelerator.org/display/guides/JIRA+Ticket+Template) as a starting point, next time. Cheers
  5. Michael White 2012-01-02

    Hi Paul. Ticket TIMOB-2588 differs from my problem. The fragment "build/iphone/build" is identical in both strings expected & was: whereas in my ticket the two strings do not match. I get "build/iphone". TIMOB-2588 ticket is to do with case sensitivity "Users" as opposed to "users". In my example Users is correct in both strings. To reproduce my problem, create a new "Titanium mobile project" in Titanium studio. Note the version of Xcode being used. Do not add any new code. Then build the project using "iPhone Simulator". That will re-produce the problem. If I launch the Xcode GUI using the .xcodeproj file created by Titanium Studio, I am able to run the project.
  6. Paul Dowsett 2012-01-02

    Michael I don't understand this ticket. Where is the error in the attached log? Would you verify that my changes to the description still describe your situation? Please, again, read [How to Submit a Bug Report](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report) - following it will prevent delays in getting your ticket escalated now and in future. Thanks
  7. Michael White 2012-01-02

    Hi Paul Near the bottom of the log you will see that TARGET_BUILD_DIR,is output to the log: this (was) string is incorrect. If you check the BUILD_DIR (expected) string it differs as described in my ticket. If you check the build.py script there is a test at line 1197. xcode will not be invoked if the test fails. I can see from the code that TARGET_BUILD_DIR must be equal to build_dir. HOWEVER in xcode 4.2 I have no idea how to correct TARGET_BUILD_DIR (ENV). The difference can clearly be seen mid string at ".....project/iphone/project....". Please carefully study my original fault report for this string fragment which I obtained from the Titanium console. For the work around I suggest this text for more clarity. Open the .xcodeproj file created by Titanium Studio by invoking the Xcode GUI. The compiled project can then be run using Xcode outside of Titanium. I will study the HowTo in more detail if I need to submit further tickets using this community. Many thanks for your patience. Unless I can find a way of correcting the TARGET_BUILD_DIR string either in Xcode or in Titanium : this ticket should remain open IMHO.
  8. Paul Dowsett 2012-01-02

    Michael I am afraid I need to be able to produce this in order to escalate it. Please would you provide this information? In the meantime, I will ask internally to see if anyone has any ideas. Cheers
  9. Michael White 2012-01-02

    To reproduce my problem, create a new "Titanium mobile project" in Titanium studio. Use Xcode 4.2.1. Do not add any new code to the project. Then build the project using "iPhone Simulator". That will re-produce the problem. It would help if the source of TARGET_BUILD_DIR was documented. Looking at the contents of this string it can only come from Titanium since Xcode can only obtain this string from the .xcodeproj file which is created by Titanium.
  10. Paul Dowsett 2012-01-03

    Michael Would you please try the advice provided in [http://developer.appcelerator.com/question/40691/mobil-sdk-130---targetbuilddir-is-incorrectly-set] ? Also, are you using the official release of 1.8.0.1? Thanks
  11. Paul Dowsett 2012-01-10

    Michael Have you had a chance to try this? Thanks
  12. Mauro Parra-Miranda 2012-02-21

    Hello, tried this with Xcode 4.2.x, Lion and Mobile SDK 1.8.1, it's working just fine. Best, Mauro

JSON Source