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

Bug Cloud builds fails for iOS

Discussion in 'Unity Build Automation' started by davidpetersims, May 18, 2023.

  1. davidpetersims

    davidpetersims

    Joined:
    Oct 16, 2018
    Posts:
    5
    I've had an issue with my iOS builds when trying to build with:
    Unity Version 2022.2.18f1
    XCode 14.1.0
    Ruby Version 2.7.4


    [error] [2023-05-18T00:59:54.796Z] - 7.3.11.2.7.4 - INFO: ▸ ❌ ld: symbol(s) not found for architecture arm64
    [error] [2023-05-18T00:59:54.827Z] - 7.3.11.2.7.4 - INFO: ▸ ❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)
    [2023-05-18T00:59:54.842Z] - 7.3.11.2.7.4 - INFO: ▸ ** ARCHIVE FAILED **
    [2023-05-18T00:59:54.842Z] - 7.3.11.2.7.4 - INFO: ▸ The following build commands failed:
    [2023-05-18T00:59:54.842Z] - 7.3.11.2.7.4 - INFO: ▸ Ld /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-gihyihszyvoesdfptbhihazrzigz/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/UnityFramework.framework/UnityFramework normal (in target 'UnityFramework' from project 'Unity-iPhone')
    [2023-05-18T00:59:54.842Z] - 7.3.11.2.7.4 - INFO: ▸ (1 failure)


    If I switch back to any 2021.x version, it works.

    I've seen similar posts in this forum where it's been recommended to use postprocessing to switch off a few switft options. Here's my code:
    Code (CSharp):
    1. using UnityEditor;
    2. using UnityEditor.Callbacks;
    3. using UnityEditor.iOS.Xcode;
    4.  
    5. public class XCodePostProcess
    6. {
    7.     [PostProcessBuild]
    8.     public static void OnPostprocessBuild(BuildTarget target, string path)
    9.     {
    10.         if (target == BuildTarget.iOS)
    11.         {
    12.             string projPath = PBXProject.GetPBXProjectPath(path);
    13.             PBXProject proj = new PBXProject();
    14.             proj.ReadFromFile(projPath);
    15.  
    16.             string targetGuid = proj.GetUnityMainTargetGuid();
    17.  
    18.             foreach (var framework in new[] { targetGuid, proj.GetUnityFrameworkTargetGuid() })
    19.             {
    20.                 proj.SetBuildProperty(framework, "ENABLE_BITCODE", "NO");
    21.                 proj.SetBuildProperty(framework, "EMBEDDED_CONTENT_CONTAINS_SWIFT", "YES");
    22.                 proj.SetBuildProperty(framework, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "NO");
    23.                 proj.SetBuildProperty(framework, "SWIFT_VERSION", "5.0");
    24.             }
    25.  
    26.             proj.WriteToFile(projPath);
    27.         }
    28.     }
    29. }
    It's a file called XCodePostProcess.cs in the Editor folder. As far as I can tell, it's working.

    I suspect that the issue started to occur after I added UnityAds to my project.
    The version of UnityAds I have is the latest: 4.4.2

    I've been having this issue for weeks and have tried many combinations of build versions and post-processing settings, but it all ends up with the same result. If I switch back to the older version of unity, it works, but that's now starting to cause issues.

    Any help would be hugely appreciated!
     
  2. Benjamin-Gooding

    Benjamin-Gooding

    Unity Technologies

    Joined:
    Apr 12, 2022
    Posts:
    242
    Do you have this issue if you build locally with batchmode?
     
  3. davidpetersims

    davidpetersims

    Joined:
    Oct 16, 2018
    Posts:
    5
    Thanks Benjamin for the suggestion. I don't have access to a Mac, but I was able to build locally on Windows in batchmode on a clean checkout of my code.
    I used the latest available version: 2022.2.20f1

    Here's the cmd line I used:
    "C:\Program Files\Unity\Hub\Editor\2022.2.20f1\Editor\unity.exe" -batchMode -skipMissingProjectID -skipMissingUPID -buildTarget iOS -logFile C:\Temp\log.txt -projectPath C:\Users\dsims\Documents\Unity\Clean -executeMethod BSLocalBuild.PerformBuild -quit


    In the log.txt:

    DisplayProgressNotification: Build Successful
    Build Finished, Result: Success.


    Any ideas as to what could be causing it?
     
    Last edited: May 23, 2023
  4. davidpetersims

    davidpetersims

    Joined:
    Oct 16, 2018
    Posts:
    5
    Quick Update: I removed UnityAds from the project (as I had suspected it might be the cause as it was added to the project not long before the issue started to arise)
    Unfortunately, I still get the exact same error.
    I'm really keen to get an iOS build out with the latest unity Version.

    Any idea what's causing this failure?
    Ld /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-gihyihszyvoesdfptbhihazrzigz/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/UnityFramework.framework/UnityFramework normal (in target 'UnityFramework' from project 'Unity-iPhone')


    The path indicates it's an Uninstalled Product. Any idea why is it still being included in a clean build?
     
  5. Benjamin-Gooding

    Benjamin-Gooding

    Unity Technologies

    Joined:
    Apr 12, 2022
    Posts:
    242
    I'd suggest open up a support ticket where you can get a little bit more help.
     
    davidpetersims likes this.
  6. gueAT

    gueAT

    Joined:
    Jan 25, 2022
    Posts:
    1
    @davidpetersims did you happen to have solved your issue? I might have encountered a similar one.