Search Unity

Bug XCode build error after upgrading to 2022.2.0

Discussion in 'iOS and tvOS' started by manuelgoellnitz, Dec 9, 2022.

  1. aimatme

    aimatme

    Joined:
    Jul 3, 2012
    Posts:
    24
    Unity 2022.2.3f1
    The problem is not fixed
    in GameAssembly target (in Run Script Build Phase) folder address from windows still exists, so compilation failed
     
    suhorukovs and newguy123 like this.
  2. suhorukovs

    suhorukovs

    Joined:
    Dec 16, 2018
    Posts:
    13
    WTF. Unity ignored all our messages.. It's not possible to build a game for ios on mac with intel core i5 and a similar error on mac air with m2.
    Unity please give a reaction on this BUG!
     
    aimatme likes this.
  3. fwalker

    fwalker

    Joined:
    Feb 5, 2013
    Posts:
    255
    Confirmed not fixed on 2022.2.3f1. We still get:
    chmod:
    /Builds/Il2CppOutputProject/IL2CPP/build/deploy_x86_64/bee_backend/mac-x86_64/bee_backend: No such file or directory

    Back to building locally :( :(
     
    suhorukovs and aimatme like this.
  4. CameronDWills

    CameronDWills

    Joined:
    Feb 26, 2021
    Posts:
    90
    • iOS: [M1] Crash on MTLGetEnvCase when building the project for iOS (UUM-22385)
    This is still in the known issues of the notes, so probably not fixed
     
    suhorukovs and aimatme like this.
  5. hekmens

    hekmens

    Joined:
    Aug 26, 2020
    Posts:
    1
    I am having same issues in 2022.2.3f1 version. Definitely rolling back to 2021 because I don't have time to wait Unity's solution...


    Showing Recent Issues

    Unhandled exception: System.InvalidOperationException: Parent is called on an empty path
    at NiceIO.NPath.get_Parent() in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 143
    at NiceIO.NPath.EnsureParentDirectoryExists() in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 765
    at NiceIO.NPath.EnsureDirectoryExists(NPath append) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 760
    at NiceIO.NPath.EnsureParentDirectoryExists() in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 765
    at NiceIO.NPath.EnsureDirectoryExists(NPath append) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 760
    at NiceIO.NPath.EnsureParentDirectoryExists() in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 765
    at NiceIO.NPath.EnsureDirectoryExists(NPath append) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 760
    at NiceIO.NPath.EnsureParentDirectoryExists() in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 765
    at NiceIO.NPath.EnsureDirectoryExists(NPath append) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 760
    at NiceIO.NPath.EnsureParentDirectoryExists() in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 765
    at NiceIO.NPath.EnsureDirectoryExists(NPath append) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 760
    at NiceIO.NPath.EnsureParentDirectoryExists() in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 765
    at NiceIO.NPath.EnsureDirectoryExists(NPath append) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 760
    at NiceIO.NPath.EnsureParentDirectoryExists() in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 765
    at NiceIO.NPath.EnsureDirectoryExists(NPath append) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 760
    at NiceIO.NPath.EnsureParentDirectoryExists() in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 765
    at NiceIO.NPath.EnsureDirectoryExists(NPath append) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 760
    at NiceIO.NPath.EnsureParentDirectoryExists() in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 765
    at NiceIO.NPath.EnsureDirectoryExists(NPath append) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 760
    at NiceIO.NPath.EnsureParentDirectoryExists() in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 765
    at NiceIO.NPath.EnsureDirectoryExists(NPath append) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Common35/NiceIO.cs:line 760
    at il2cpp.Il2CppOptionParser.SetupOtherArguments(Il2CppCommandLineArguments il2CppCommandLineArguments, List`1 foundAssemblies) in /Users/bokken/build/output/unity/il2cpp/il2cpp/Il2CppOptionParser.cs:line 133
    at il2cpp.Il2CppOptionParser.ParseArguments(String[] args, Boolean& continueToRun, ExitCode& exitCode, RuntimePlatform& platform, Il2CppCommandLineArguments& il2cppCommandLineArguments, BuildingOptions& buildingOptions) in /Users/bokken/build/output/unity/il2cpp/il2cpp/Il2CppOptionParser.cs:line 67
    at il2cpp.Program.Run(String[] args, Boolean setInvariantCulture, Boolean throwExceptions) in /Users/bokken/build/output/unity/il2cpp/il2cpp/Program.cs:line 61
    at il2cpp.Program.Main(String[] args) in /Users/bokken/build/output/unity/il2cpp/il2cpp/Program.cs:line 36

    Command PhaseScriptExecution failed with a nonzero exit code
     
    newguy123 and suhorukovs like this.
  6. suhorukovs

    suhorukovs

    Joined:
    Dec 16, 2018
    Posts:
    13
    what about 2022.2.4? who tested?
     
  7. suhorukovs

    suhorukovs

    Joined:
    Dec 16, 2018
    Posts:
    13
    Oh god. no. the bug is still there. Unity does not support building for IOS anymore((( switching to Unreal?
     
  8. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    @hekmens I'm getting same issue
     
    suhorukovs likes this.
  9. suhorukovs

    suhorukovs

    Joined:
    Dec 16, 2018
    Posts:
    13
    It's fixed only in 2023.1.0b1.. no words..(( when it will be fixed in 2022.2.xxx?
     
  10. aimatme

    aimatme

    Joined:
    Jul 3, 2012
    Posts:
    24
    Update, Unity3d 2022.2.4 error still exists
     
    suhorukovs likes this.
  11. fwalker

    fwalker

    Joined:
    Feb 5, 2013
    Posts:
    255
    Ahhhhhggg... Unity show us some love !! :)
     
    suhorukovs likes this.
  12. Juason

    Juason

    Joined:
    Feb 7, 2017
    Posts:
    11
    I received an email today indicating "Your bug report has been confirmed and transferred to the appropriate internal development team at Unity. Your bug report has the following internal ID: UUM-25722"

    Whether or not "confirmed" means they have duplicated it or are now starting to duplicate it remains to be seen.
     
    suhorukovs likes this.
  13. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,930
    Yes, that means our QA team has reproduced the problem locally and a development team is working on a fix for it.
     
  14. fwalker

    fwalker

    Joined:
    Feb 5, 2013
    Posts:
    255
    And there is the love!!! :) Nice
     
  15. CameronDWills

    CameronDWills

    Joined:
    Feb 26, 2021
    Posts:
    90
  16. JackmanGomel

    JackmanGomel

    Joined:
    Jun 3, 2015
    Posts:
    26
    I use 2022.2.2f1 and 2022.2.4f1 and I get the error as on the screenshot. Also I did chmod +x and chmod 755 and it didn`t work. I build xcode project on Windows and after build on Ventura xcode version is 14.2
     

    Attached Files:

    Last edited: Feb 9, 2023
    newguy123 likes this.
  17. Axel-F

    Axel-F

    Joined:
    Mar 20, 2009
    Posts:
    224
    I'm getting the same error when building for iOS on my Windows machine and then transferring the content to my Mac Mini M1. I think all we can do is to wait for a patch.
    Argh, I really don't want to downgrade to 2022.1 again.
     
    Last edited: Feb 9, 2023
    newguy123 likes this.
  18. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Same issue here like @Axel-F
    I use my Mac mini for iOS building only and do the main work on the windows unity editor version
    The possibility to build in this scenario is broken from first 2022.2 release already, that has to be at least 2 months now ?

    BTW:
    I'm just installing 2022.2.6f1, but i have minimal hope that this issue is fixed there as there snothing in the changelog
     
    newguy123 likes this.
  19. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    I was right, issue is still there in 2022.2.6f1
    It's insane that the case of "Export iOS project on Windows and build in Xcode" is not covered by automatic testing
     
    newguy123 and CameronDWills like this.
  20. Sun-Pengfei

    Sun-Pengfei

    Joined:
    Nov 12, 2015
    Posts:
    37
    2022.2.4 still has this issue. And the "unity requires java 11" issue too.
     
  21. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    The known Issue is gone with 2022.2.6 but the bug is still there.
     
  22. Ololi

    Ololi

    Joined:
    Dec 26, 2020
    Posts:
    1
    In Xcode Project:
    GameAssembly -> BuildPhase -> RunScript
    Scroll all the way down to --data-folder = ....
    Replace:
    --data-folder="$PROJECT_DIR/Data/Managed"

    For me it worked.

    Project: Empty 3D URP
    Unity 2022.2.6f1 on Win11 Project - Build - Settings for iOS
    Moved the builded Xcode Project to an Mac Air M1 (macOS Ventura 13.2)
    Open Project Folder in Console and sudo chmod +x *
    Then opened it in Xcode (14.2)
    And did the steps above.
     
    Last edited: Feb 15, 2023
  23. Spellbook

    Spellbook

    Joined:
    May 21, 2015
    Posts:
    30
    Would it be possible to have a status update, work-around or ETA on this? Normally I wouldn't bother you folks but this is a show-stopping existential problem. We are not able to publish Unity apps on iOS.
     
  24. Axel-F

    Axel-F

    Joined:
    Mar 20, 2009
    Posts:
    224
    Sorry, but this did nothing in my project.
     
  25. aimatme

    aimatme

    Joined:
    Jul 3, 2012
    Posts:
    24
    The problem still not resolved in 2022.2.6
     
  26. Tupolov73

    Tupolov73

    Joined:
    Nov 14, 2019
    Posts:
    1
    This worked for me. Thanks!

    Make sure that there is no space between folder and =

    --data-folder="$PROJECT_DIR/Data/Managed"
     
    Last edited: Feb 14, 2023
    Ololi and Axel-F like this.
  27. Axel-F

    Axel-F

    Joined:
    Mar 20, 2009
    Posts:
    224
    Ah, indeed - now it worked! Cool! At least a workaround...
     
    Ololi and Tupolov73 like this.
  28. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    The workaround works with one addition:
    I had to do
    chmod -R +x *
    because one file the builde script wanted to run was in a subfolder

    When you see the line that is replaced with "--data-folder="$PROJECT_DIR/Data/Managed"" you see that the build script obviously never could work, since there is a local windows folder in that line...
     
    Bulteir and CameronDWills like this.
  29. CameronDWills

    CameronDWills

    Joined:
    Feb 26, 2021
    Posts:
    90
    The previous posts didn't work for me, until adding the chmod line above.

    Thank you!
     
  30. hexdecc

    hexdecc

    Joined:
    Oct 24, 2014
    Posts:
    146
    I tried everything but not found solution for this ,I really want to cry , I cannot public new version after 3 month development.
     
  31. Evgeno

    Evgeno

    Joined:
    Sep 8, 2014
    Posts:
    57
    Unity 2022.2.7, the problem is still there.
     
    spacefrog likes this.
  32. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Yep, just came here to confirm this.
    Thats pretty frustrating to say at least ....
    Gonna try the workarrounds posted here
     
    newguy123 likes this.
  33. Evgeno

    Evgeno

    Joined:
    Sep 8, 2014
    Posts:
    57
    Maybe I did something wrong, but the workarounds did not help me. I would like to see an official fix, since in version 2021 it compiles without errors. It is strange why such critical errors are not corrected for so long.
     
  34. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Same here -> workarrounds did'nt help and i did'nt want to spend more time and energy to investigate

    Unity Team! Wake Up !
     
  35. CameronDWills

    CameronDWills

    Joined:
    Feb 26, 2021
    Posts:
    90
    It's probably worth mentioning that building in windows and then transferring over to a mac always worked without issues in Unity 2021, but ever since 2022 it won't work because of the way the pod install happens (not a mac guy so I'm not even sure what pods are), but it basically fails during the windows build process because you can't run pod commands on windows (you can see it failing in the Unity console log when the build is complete)

    You have to build on Windows, transfer to mac, and then right click on the folder containing your game files and open a new terminal window. You have to type the command: pod install (sometimes more than once)

    This creates a workspace file you'll need to open and build from that (don't open the normal xcode project file.. make sure it's the workspace). This worked fine in 2022.1 but now in 2022.2 you'll have to do that, plus the additional workaround from the posts above to get it to work
     
  36. Evgeno

    Evgeno

    Joined:
    Sep 8, 2014
    Posts:
    57
    I always open the workspace file after installing the pod, but it still causes errors when building in the 2022 version.
     
  37. Juason

    Juason

    Joined:
    Feb 7, 2017
    Posts:
    11
    As I commented on heavily in my original replies, installing Unity on my Mac, opening the project and compiling it there did not produce any better results. Has anyone done this and confirmed it *should* work better without these extra steps that may or may not work correctly? I'm hesitant to get my setup back into a broken state at this time... though some of the features of 2022/3+ would be nice to have access to.
     
  38. hexdecc

    hexdecc

    Joined:
    Oct 24, 2014
    Posts:
    146
    i have downgrade the project version : 2022.1.21f and finally I can get build without error.
    don't forget after exporting project type "pod install" in terminal
     
  39. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    I got no problems exporting or building the same project directly from the Mac OS version of the Unity Editor on my slow and aging Mac mini. It's definitely the Unity Editor on Windows that has this problem with iOS Export
     
    aimatme and newguy123 like this.
  40. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    The build process work now with that workaround.
    But the app keeps crashing with some kind of "bad memory access" error.
    So back to 2021 again :(
     
    AlienMe likes this.
  41. hexdecc

    hexdecc

    Joined:
    Oct 24, 2014
    Posts:
    146
    try this ; 2022.1.21f
     
  42. AlienMe

    AlienMe

    Joined:
    Sep 16, 2014
    Posts:
    93

    Same here, the workaround fixed the build issue, but the game crashes 100% of the time after a few seconds of running with an EXC_BAD_ACCESS exception inside URP's RenderSingleCamera.

    Going back to 2022.1.24 fixes this.
    .
     
  43. aimatme

    aimatme

    Joined:
    Jul 3, 2012
    Posts:
    24
    Here comes quick fix of the problem, combining two workarounds:
    1. --data-folder="$PROJECT_DIR/Data/Managed"
    2. chmod -R +x *

    After that created in windows and moved to macos xcode project was successfully builded in xcode and uploaded to testflight (via Jenkins CI)

    Code (CSharp):
    1.     [PostProcessBuild(999)]
    2.     public static void OnPostProcessBuild(BuildTarget buildTarget, string path)
    3.     {
    4.         if (buildTarget != BuildTarget.iOS)
    5.             return;
    6.  
    7.         var projectPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
    8.         //UNITY 2022.2.X FIX https://forum.unity.com/threads/xcode-build-error-after-upgrading-to-2022-2-0.1371966/
    9.         var projRaw = File.ReadAllText(projectPath);
    10.         projRaw = projRaw.Replace("chmod +x \\\"$IL2CPP\\\"",
    11.             "chmod -R +x *\\nchmod +x \\\"$IL2CPP\\\"");
    12.         projRaw = Regex.Replace(projRaw, "--data-folder=\\\\\"([^\"]*)\\\\\"",
    13.             "--data-folder=\\\"$PROJECT_DIR/Data/Managed\\\"");
    14.         File.WriteAllText (projectPath, projRaw);
    15.     }
     
  44. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    How to explain in plain language what should I do with this info?

    All I do is save your script and stick it on a empty gameobject?
     
  45. aimatme

    aimatme

    Joined:
    Jul 3, 2012
    Posts:
    24
    I have AutoBuilder.cs file in Editor folder.
    Inside of AutoBuilder.cs there is the class "internal static class AutoBuilder"
    Inside of class there is OnPostProcessBuild function.

    You do not need any gameobjects or monobehaviours

    PostProcess usage example
    https://docs.unity3d.com/ScriptReference/Callbacks.PostProcessBuildAttribute.html
     
  46. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Awesome !
    That postbuild script finally fixed the issue for me ! Thanks a lot for sharing it
     
    aimatme likes this.
  47. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    @spacefrog please could you explain step by step what to do to fix this. I don't understand what I should do with the info @aimatme provided. The info seems to suggest the script provided, is part of a larger script. What is the complete script and can I stick it in any Editor folder under Assets?
     
  48. Axel-F

    Axel-F

    Joined:
    Mar 20, 2009
    Posts:
    224
    Create a new script in Assets/Editor - and name it (e.g.) MyBuildPostprocessor.cs

    With the following content:

    Code (CSharp):
    1.  
    2. using System.IO;
    3. using System.Text.RegularExpressions;
    4. using UnityEditor;
    5. using UnityEditor.Callbacks;
    6. public class MyBuildPostprocessor
    7. {
    8.     [PostProcessBuild(999)]
    9.     public static void OnPostProcessBuild(BuildTarget buildTarget, string path)
    10.     {
    11.         if (buildTarget != BuildTarget.iOS)
    12.             return;
    13.         var projectPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
    14.         //UNITY 2022.2.X FIX https://forum.unity.com/threads/xcode-build-error-after-upgrading-to-2022-2-0.1371966/
    15.         var projRaw = File.ReadAllText(projectPath);
    16.         projRaw = projRaw.Replace("chmod +x \\\"$IL2CPP\\\"",
    17.             "chmod -R +x *\\nchmod +x \\\"$IL2CPP\\\"");
    18.         projRaw = Regex.Replace(projRaw, "--data-folder=\\\\\"([^\"]*)\\\\\"",
    19.             "--data-folder=\\\"$PROJECT_DIR/Data/Managed\\\"");
    20.         File.WriteAllText(projectPath, projRaw);
    21.     }
    22. }
    23.  
    This script will be triggered each time a build has been completed.

    All credits go to @aimatme
     
    Last edited: Feb 22, 2023
  49. Evgeno

    Evgeno

    Joined:
    Sep 8, 2014
    Posts:
    57
    Oh, how many problems with the assembly for iOS. With the OnPostProcessBuild code, this error is gone, but now there is a new one

    '/Users/mac/Library/Developer/Xcode/DerivedData/Unity-iPhone-aitdhgfpvhwmzicjgofayqaaozvv/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/PromisesObjC/FBLPromises.framework/FBLPromises(FBLPromise.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/mac/Library/Developer/Xcode/DerivedData/Unity-iPhone-aitdhgfpvhwmzicjgofayqaaozvv/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/PromisesObjC/FBLPromises.framework/FBLPromises' for architecture arm64
     
  50. aimatme

    aimatme

    Joined:
    Jul 3, 2012
    Posts:
    24
    To fix ENABLE_BITCODE just add to your OnPostProcessBuild

    Code (CSharp):
    1.         //ENABLE BITCODE FALSE FIX
    2.         var projectPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
    3.         var pbxProject = new PBXProject();
    4.         pbxProject.ReadFromFile(projectPath);
    5.         foreach (var targetGuid in new[] { pbxProject.GetUnityMainTargetGuid(), pbxProject.GetUnityFrameworkTargetGuid()})
    6.         {
    7.             pbxProject.SetBuildProperty(targetGuid, "ENABLE_BITCODE", "NO");
    8.         }
    9.         pbxProject.WriteToFile(projectPath);
    In most cases this can help