Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26110] Xcode 10: Cannot build application with new (default) build system

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-06-20T14:32:59.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.4.0
ComponentsiOS
Labelscb-tooling
ReporterHans Knöchel
AssigneeHans Knöchel
Created2018-06-08T00:27:47.000+0000
Updated2018-11-01T14:18:39.000+0000

Description

When using Xcode 10 and the new build system, the app build fails because the /build/iphone/build directory is generated by our CLI instead of the actual xcodebuild command. While this was okay in the past, the new build system complains about that. I filed a radar at https://openradar.appspot.com/40906897 and talked to the Apple engineers during WWDC. They assume it to be an issue in the new build system, but we can actually fix it on our end by now pre-creating the directory and let xcodebuild create it. I tested it as a local change and it works with both Xcode 10 and 9. Error:
[INFO]  Cleaning Xcode derived data
[DEBUG] Invoking: DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer /Applications/Xcode-beta.app/Contents/Developer/usr/bin/xcodebuild clean
[ERROR] note: Using new build system
[ERROR] error: Could not delete /Users/hknoechel/Documents/Apps/myapp/build/iphone/build because it was not created by the build system and it is not a subfolder of derived data.
[ERROR] ** CLEAN FAILED **

Comments

  1. Hans Knöchel 2018-06-20

    PR: https://github.com/appcelerator/titanium_mobile/pull/10123
  2. Samir Mohammed 2018-08-27

    [~hknoechel] Using 7_4_X (7.4.0.v20180824134643) I get the error below but on Master (7.5.0.v20180824145645) the application runs without issues.
       [ERROR] :  note: Using new build system
       [ERROR] :  error: Could not delete /Users/Samir/Desktop/newWS/test3/build/iphone/build because it was not created by the build system and it is not a subfolder of derived data.
       [ERROR] :  ** CLEAN FAILED **
       
    *Test Environment*
       APPC Studio:  5.1.0.201808080937
       APPC CLI: 7.0.6-Master.5
       iphone 6 simulator (12.0)
       Operating System Name: Mac OS High Sierra
       Operating System Version: 10.13.6
       Node.js Version: 8.9.1
       Xcode 10.0 beta 6
       
  3. Samir Mohammed 2018-08-28

    *Closing ticket* Verified fix in SDK version: 7.4.0.v20180827125633 and 7.5.0.v20180827102657. *Test Steps (FR Passed):*

    Created a new titanium project

    Ran the program ensuring newest beta of XCode is installed along with IOS 12. beta

    Application no longer showed the error above in the description and ran without issues

    *Test Environment*
       APPC Studio:  5.1.0.201808080937
       APPC CLI: 7.0.6-Master.5
       iphone 6 simulator (12.0)
       Operating System Name: Mac OS High Sierra
       Operating System Version: 10.13.6
       Node.js Version: 8.9.1
       Xcode 10.0 beta 6
       
  4. jack sparrow 2018-10-27

    i have same issue any solution ?
  5. alejandro_capel 2018-10-27

    Hi Jack, it is a very strange thing!! I have reproduced this issue several times. In my case I have to delete build folder while compiling en iOS simulator. Try to do it. Regards.
  6. Diego Freniche 2018-10-29

    What I've done is just use inside <ios> tag:
       <ios>
           <use-new-build-system>false</use-new-build-system>
       
  7. Raymond Verbruggen 2018-10-30

    URGENT! I have checked-out a SDK 6.3.0 project from subversion in order to implement a small update. The same error appears here. Adding the false into the section does not help. What to do?
  8. Hans Knöchel 2018-10-30

    [~ray@raymondverbruggen.nl] This change was added in 7.4.0 as part of the general Xcode 10 support. If you cannot update to SDK 7.4.0+ so far, you either need to use Xcode 9 or patch your SDK manually (adding -UseNewBuildSystem=NO to the "xcodebuild" commands (build and clean).
  9. Raymond Verbruggen 2018-10-30

    I cannot update to SDK 7, because the supplier of the Bluetooth module is not willing to update... How can I patch the SDK manually? I checked-out another SDK 6.3.0 project from subversion and that project builds without errors... It is a classic project (from 2012), so not alloy. Is that logical?
  10. Raymond Verbruggen 2018-10-31

    Good morning! Yesterday evening I checked out two SDK 6.3.0 projects (both alloy) and in the first try it did not got the above error message. However when I do a Project-Clean, every project gives the error message. 1) How do I this suggestion from you: adding -UseNewBuildSystem=NO to the "xcodebuild" commands (build and clean)? 2) OR: create a patch that enables SDK 6.x to work with the new build system :)
  11. Chris Barber 2018-10-31

    I suspect the problem stems from this line: https://github.com/appcelerator/titanium_mobile/blob/7_5_X/iphone/cli/commands/_build.js#L2462-L2463 where we force the new build system when using Xcode 10 or newer. You CANNOT disable the new build system in the tiapp.xml when building with Xcode 10 or newer. We then pass -UseNewBuildSystem=YES into both the xcodebuild clean and xcodebuild build calls. If I recall correctly, the problem isn't that we're being explicit, but rather that Xcode 10 defaults to the new build system for xcodebuild clean command, but not the build action. So we chose to be explicit to override Xcode's inconsistent default behaviors. What "we" (myself, Titanium developers, contributors) need to do is install both Xcode 9 and Xcode 10 and test all combinations (clean builds, incremental builds, with flag set in tiapp, vice versa, etc). I'll raise this issue in standup and maybe someone can investigate sooner than I can.
  12. Raymond Verbruggen 2018-10-31

    Beautiful, thank you for your update! I would prefer to determine on a per-project basis whether to use the new build system or not. For example in the tiapp.xml file. For maintenance of apps (I am working with appcelerator already since 2013) I need to be able to do small updates to "old" apps without the need of going for example from SDK 6.3 to 7.4 or so. I also added some comments in this great blog by Jason Keen: https://www.appcelerator.com/blog/2018/10/running-xcode-9-xcode-10-side-side/ Maybe there is an opportunity of improving the overall situation.
  13. Chris Barber 2018-11-01

    I tested this with Xcode 9.4.1/iOS 11.4 and Xcode 10.1/iOS 12.1 and with Titanium SDK 7.4.1.GA and sadly I cannot reproduce. I tested both simulator and device builds. I will need to mess around a bit more and see if I can put stuff in build/iphone/build and cause the clean to fail, then try to figure out why. Can somebody who is encountering this problem try creating a new Alloy app and see if you can reproduce? I'd like to know: * Does this happen for new apps? * Does it happen during a clean build or an incremental build? * Are you using a Titanium module that could be copying in some assets that are causing the problem? * Is this happening for simulator builds, device builds, or both? * Are you using the CLI or Studio? * What Node.js version? (I doubt this matters, but you never know)

JSON Source