Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6583] iOS: Renaming a project causes "xcodebuild error. directory contains 2 projects"

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 1.8.0.1
Fix Version/sn/a
ComponentsiOS
Labelscb-tooling, engSchedule, tbs-1.8.2
ReporterIngo Muschenetz
AssigneeChris Barber
Created2011-12-12T15:50:52.000+0000
Updated2020-02-05T05:31:31.000+0000

Description

Renaming a mobile application can result in the following error when attempting to build:
[ERROR] xcodebuild: error: The directory /Users/zpapp/Titanium
Workspace/babyfaces/build/iphone contains 2 projects, including multiple
projects with the current extension (.xcodeproj). Specify the project to
use with the -project option.
[ERROR]
[ERROR] Error: Traceback (most recent call last):
   File "/Users/zpapp/Library/Application
Support/Titanium/mobilesdk/osx/1.8.0.1.v20111123113857-babyfaces/iphone/builder.py",
line 1413, in main
     execute_xcode("iphoneos%s" % iphone_version,args,False)
   File "/Users/zpapp/Library/Application
Support/Titanium/mobilesdk/osx/1.8.0.1.v20111123113857-babyfaces/iphone/builder.py",
line 1175, in execute_xcode
     output = run.run(args,False,False,o)
   File "/Users/zpapp/Library/Application
Support/Titanium/mobilesdk/osx/1.8.0.1.v20111123113857-babyfaces/iphone/run.py",
line 39, in run
     sys.exit(rc)
SystemExit: 78
Steven suggests passing the explicit project on the command-line would fix this.

Comments

  1. Shannon Hicks 2012-01-24

    This problem has been around for a long time. Here's the scenario: You have a project named "MyProject" In tiapp.xml, you have "My Project" Do a debug/run build of the app in the Simulator Do a Distribut build, and you get this error:
       [INFO] Performing clean build
       [ERROR] xcodebuild: error: The directory /path/to/project/MyProject/build/iphone contains 2 projects, including multiple projects with the current extension (.xcodeproj). Specify the project to use with the -project option.
       [ERROR] 
       [ERROR] Error: Traceback (most recent call last):
         File "/Users/shan/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1/iphone/builder.py", line 1482, in main
           execute_xcode("iphoneos%s" % iphone_version,args,False)
         File "/Users/shan/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1/iphone/builder.py", line 1180, in execute_xcode
           output = run.run(args,False,False,o)
         File "/Users/shan/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1/iphone/run.py", line 39, in run
           sys.exit(rc)
       SystemExit: 78
       
    In the build/iPhone directory, there are two xcodeproj files (and similarly named supporting files): MyProject.xcodeproj My Project.xcodeproj Workaround: Do a Project > Clean every time you want to switch between debug/run and Distribute builds. Very annoying.
  2. Ingo Muschenetz 2012-01-27

    Bump. We have run into this issue a lot of times recently.
  3. Fokke Zandbergen 2014-05-14

    Please fix this. It's annoying and easy to fix. The CLI just needs to pass the current project name to xcodebuild as indicated by the error:
       [ERROR] xcodebuild: error: The directory /Users/zandbergen/dev/apps/mgl/build/appify/build/iphone contains 2 projects, including multiple projects with the current extension (.xcodeproj). Specify the project to use with the -project option.
       
  4. Chris Barber 2016-08-22

    Confirmed, this is still an issue with Titanium SDK 6.1.0. For a workaround, clean the project and rebuild.
  5. Joe 2019-10-16

    Bump. This still happens in 8.0.2.GA thankfully google found this issue to help figure out the problem. How about improving/modifying the error message "Clean your project and try again" as a work around.

JSON Source