Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Xcode Legacy Build system is deprecated

Discussion in 'iOS and tvOS' started by mark_rendle, Nov 3, 2020.

  1. mark_rendle

    mark_rendle

    Joined:
    Feb 22, 2019
    Posts:
    24
    When I open my Unity-generated project in Xcode, I get a bunch of warnings, including a message about the Legacy Build System being deprecated. I thought I'd try switching it to the New Build System, and it seemed to build OK, but the next time I went to build from Unity and chose "Append" I got an error about "Deletion of any of the unity targets is not supported". I can build fine with Replace and then it gets switched back to the Legacy Build System.

    Is Unity going to generate projects with the New Build System selected soon?
     
  2. flip_the_unflappable

    flip_the_unflappable

    Joined:
    Jul 9, 2020
    Posts:
    11
    +1 I am interested in this question.

    Or is there a way to change this setting using
    PostProcessBuildAttribute?
     
  3. Gardosen

    Gardosen

    Joined:
    Oct 25, 2014
    Posts:
    39
    same question here, why is something like this not addressed anywhere?
     
  4. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    502
    You could make a post processing script edit this file after the xcode project is built out: YourProject.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings, either edit a raw string or load the file with an XML parser, look for and remove this part ie. there's no setting to change the value of Original to something else, it's the lack of this value at all which will enable the project to use the new build system:

    Code (CSharp):
    1. <key>BuildSystemType</key>
    2.     <string>Original</string>
     
    Last edited: Mar 26, 2021
  5. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    502
    Is there any indication from Unity if they expect to have any issues with the new xcode build system? like is there any reason to not use it??
     
  6. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    502
    Btw - anyone trying to find how to check or change the build system value in an Xcode project, look in File > Project Settings, or by clicking on the little orange hammer icon in the top middle of Xcode.
     
    laphil and -chris like this.
  7. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    502
    Last edited: Mar 26, 2021
  8. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,003
    I've been building with the new system for a while there are no issues. I'm not sure why the project Unity creates doesn't default to it.
     
  9. Nevazhnov

    Nevazhnov

    Joined:
    Jul 11, 2019
    Posts:
    8
    I've actually run into issue while was trying to make a [PostProcessBuild] script for this particular purpose.
    Unity generates .xcodeproj but not the .xcworkspace file. Search says there is no entries of WorkspaceSettings.xcsettings in whole folder.

    Good sir, could you please share your PostProcessBuild code snippet for that or pinpoint exact place of file?
     
  10. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    502
    Hi there, I've got my post process snippet in the following forum thread, but note that I've noticed recently that the workspace settings file is no longer being created as well. I don't know if this is because of an Xcode update, or because of a change to the Unity template that gets used to build out the xcode project. But in my case despite that settings file missing the project seems to be set to use the new default build system not the legacy one, so it doesn't seem to matter for me anymore. I can tell you that Unity changed the default setting to the new default as of 2020.3.10:
    https://forum.unity.com/threads/202...sembly-run-script-build-phase-errors.1083767/
     
    Nevazhnov likes this.
  11. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,602
    new build system should be used on latest 2019/2020/2021
     
  12. zagorchev

    zagorchev

    Joined:
    Aug 21, 2020
    Posts:
    1
    Hi Alexey,

    With the new build system, what is the status of the xcframeworks support and how should they be imported in the plugins?
    Can you elaborate more on this note from the release:
    • iOS: Ignore plugins with wrong CPU type when creating xcode project, e.g. when building for run on device, libraries having CPU type "x64" (i.e. simulator libraries) will be ignored

    I am trying to create a package which contains an xcframework. When imported, the aim is to be able to export for both device and simulator targets but currently fails with "Plugin is used from several locations", "Plugins colliding with each other."

    Thanks!
     
  13. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,602
    Well thats unrelated. The new build system is xcode build system and it is independent of any unity side handling of plugins
    In short this is the only issue we had with "modern" xcode build system. Legacy build system was simply ignoring the libs of the wrong arch, so you could have, say, 3 libs for armv7, arm64, x64 in the xcode project and when building for arm64 the other two would be silently ignored. Now this is an error. This is about an easy fix for this scenario: if you have 3 libs like this, and you mark them with an appropriate arch, we will not add the ones with the "wrong" architecture into the xcode project.
    This is something with out plugins handling (the idea of having one "fat" framework is perfectly fine). I guess bug report with repro project?
     
  14. Nevazhnov

    Nevazhnov

    Joined:
    Jul 11, 2019
    Posts:
    8
    I suggest you option which worked for me:
    1. Open Xcode, goto project settings (click topmost icon in project navigator)
    2. Go to "UnityFramework" target
    3. Go to "Build Phases"
    4. Expand "Link Binary with Libraries"
    5. Delete both entries of *.framework BUT make sure *.xcframework is in there

    This happens because Unity detects *.framework under Assets folders and sets default import settings. To avoid this just untick every goddamn checkbox (even iOS) for both entries of *.framework under .xcframework (which is treated as folder in Unity).

    Hope it will help :)
     
  15. flip_the_unflappable

    flip_the_unflappable

    Joined:
    Jul 9, 2020
    Posts:
    11
    shochet likes this.
  16. Gillissie

    Gillissie

    Joined:
    May 16, 2011
    Posts:
    294
    This doesn't seem to be the case in Unity 2020.3.7, which I am using right now and seeing this anytime I make a new build (not append).
     
  17. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,602
  18. polyphonic13

    polyphonic13

    Joined:
    Apr 2, 2013
    Posts:
    17
    It's very unfortunate when the response to Unity issues are "upgrade to the new version of Unity". Unity is so fragile, updating versions after a working app is completed has always lead to further issues and problems. I successfully deployed several versions of a mobile game to the Play and App Stores using Unity 2019.3.2f1. Updating the app to a newer build of Unity is not an option.
     
  19. polyphonic13

    polyphonic13

    Joined:
    Apr 2, 2013
    Posts:
    17
    "new build system should be used on latest 2019/2020/2021"

    Doesn't seem to be accurate, as 2019 is still causing this error.
     
  20. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,602
    > Fixed in Unity 2019.4.29f1
    did you try on this one or newer?