Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 10 New Build System Clean Issue

I recently updated my Xcode to 10. As a default, "New Build System" was enabled. When I build my project, I have noticed that my changes won't work on Simulator. When I try to debug this code, Xcode displays the correct changed source code, but the code executed is old.

When I change back to "legacy" build system, everything works fine.

Anybody with similar experience?

Thanks

This might be an issue with Cocoapods. Because I did unlocked podfile and try to edit some codes.

like image 429
Göktuğ Aral Avatar asked Sep 25 '18 11:09

Göktuğ Aral


People also ask

How do I clean up my Xcode build?

To clean the build folder you can use the shortcut Command+Option+Shift+K or Menu Bar → Product → Hold Option Key → Clean build Folder .

What is legacy build system Xcode?

If you need it, the legacy build system is still available in Xcode 10. To use the legacy build system, select it in the File > Project/Workspace Settings sheet. Projects configured to use the legacy build system will display an orange hammer icon in the Activity View.

How do I change the build system in Xcode?

Firstly, open your project with Xcode and navigate to File > Workspace Settings. 2. Click on the drop-down labeled with Build System then select Legacy Build System from the menu. Finally, click on the Done button to apply your change.

What build system does Xcode use?

The new building system introduced in Xcode 10 is written by Swift from scratch, and brings lots of improved performance and reliability.


1 Answers

In Xcode 10 new build system is made as default. You will face the problem with your project after updating Xcode 10. Apple was aware of these issues and they mentioned this in Xcode 10 release notes.

https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes/build_system_release_notes_for_xcode_10

  • When performing xcodebuild clean on a project that uses a customized build location outside the derived data directory, and that has older build products produced prior to Xcode 10, Xcode might report an error indicating that it won't delete directories not created by the new build system. (40427159)

    Workaround: Delete the build folder manually.


For reference, here's the full Known Issues section; the clean failure is last:

Known Issues:

  • Incremental builds may fail to codesign properly for non-source related changes to your project, such as resource file modifications, which can result in the app failing to launch. (41254808)

    Workaround: Change a source file within the same target to trigger the codesign process, or perform a clean build.

  • After installing a Swift toolchain, Xcode won't immediately detect the toolchain. (31360319)

    Workaround: Close and reopen the workspace.

  • The new build system doesn't support On Demand Resources (ODR). If your project uses ODR, the legacy build system can be reenabled in File > Workspace/Project Settings. (31508570)

  • When build settings are defined in an xcconfig file that inherit values using $(inherited) or $(), the Build Settings editor shows the last assigned value for the setting instead of the properly composed value. (28572636)

  • Targets which have multiple asset catalogs that aren't in the same build phase may produce an error regarding a "duplicate output file". (39810274)

    Workaround: Ensure that all asset catalogs are processed by the same build phase in the target.

  • The new "Build with Timing Summary" command doesn't show timings for some tasks run within the build system during the build. (39801746)

  • Custom build system plugins—including the Intel ICC compiler—are not yet supported. (32795438, 33286594)

    Workaround: If required, switch to using the legacy build system in the File > Project/Workspace Settings sheet.

  • Targets with Copy Headers build phases ordered after Compile Sources build phases may fail to build and emit a diagnostic regarding build cycles. (39880168)

    Workaround: Arrange any Copy Headers build phases before Compile Sources build phases.

  • When performing xcodebuild clean on a project that uses a customized build location outside the derived data directory, and that has older build products produced prior to Xcode 10, Xcode might report an error indicating that it won't delete directories not created by the new build system. (40427159)

    Workaround: Delete the build folder manually.

like image 183
Manikandan Avatar answered Sep 22 '22 13:09

Manikandan