[TIMOB-26110] Xcode 10: Cannot build application with new (default) build system
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-06-20T14:32:59.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.4.0 |
Components | iOS |
Labels | cb-tooling |
Reporter | Hans Knöchel |
Assignee | Hans Knöchel |
Created | 2018-06-08T00:27:47.000+0000 |
Updated | 2018-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 **
PR: https://github.com/appcelerator/titanium_mobile/pull/10123
[~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.
*Test Environment*
*Closing ticket* Verified fix in SDK version:
7.4.0.v20180827125633
and7.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*i have same issue any solution ?
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.
What I've done is just use inside
<ios>
tag: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
[~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).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?
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 :)
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 thexcodebuild clean
andxcodebuild 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 forxcodebuild clean
command, but not thebuild
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.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.
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)