Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

BuildFailedException for AR Foundation in 2019.2

Discussion in 'ARKit' started by MaxXR, Aug 31, 2019.

  1. MaxXR

    MaxXR

    Joined:
    Jun 18, 2017
    Posts:
    67
    Hi all
    On windows trying to build AR Foundation scene (with LWRP and VFX graph) to ios (not directly but to folder so that i can then transfer to my mac and build to ios. Tested default AR foundation on 2019.1 and it worked.

    However, on 2019.2 i'm getting this error:
    Code (CSharp):
    1. BuildFailedException: Could not determine which version of Xcode was selected in the Build Settings. Xcode app was computed as .
    2. UnityEditor.XR.ARKit.LibUtil.SelectPlugin (UnityEditor.PluginImporter libXcode10, UnityEditor.PluginImporter libXcode11) (at Library/PackageCache/com.unity.xr.arkit@3.0.0-preview.1/Editor/LibUtil.cs:19)
    3. UnityEditor.XR.ARKit.ARKitBuildProcessor+Preprocessor.SelectStaticLib () (at Library/PackageCache/com.unity.xr.arkit@3.0.0-preview.1/Editor/ARKitBuildProcessor.cs:93)
    4. UnityEditor.XR.ARKit.ARKitBuildProcessor+Preprocessor.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.xr.arkit@3.0.0-preview.1/Editor/ARKitBuildProcessor.cs:106)
    5. UnityEditor.Build.BuildPipelineInterfaces+<OnBuildPreProcess>c__AnonStorey0.<>m__1 (UnityEditor.Build.IPreprocessBuildWithReport bpp) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:376)
    6. UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List`1[T] oneInterfaces, System.Action`1[T] invocationOne, System.Collections.Generic.List`1[T] twoInterfaces, System.Action`1[T] invocationTwo, System.Boolean exitOnFailure) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:356)
    7. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    8.  
    9. BuildFailedException: Could not determine which version of Xcode was selected in the Build Settings. Xcode app was computed as .
    10. UnityEditor.XR.ARKit.LibUtil.SelectPlugin (UnityEditor.PluginImporter libXcode10, UnityEditor.PluginImporter libXcode11) (at Library/PackageCache/com.unity.xr.arkit@3.0.0-preview.1/Editor/LibUtil.cs:19)
    11. UnityEditor.XR.ARKit.BuildProcessor.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.xr.arkit-face-tracking@3.0.0-preview.1/Editor/BuildProcessor.cs:15)
    12. UnityEditor.Build.BuildPipelineInterfaces+<OnBuildPreProcess>c__AnonStorey0.<>m__1 (UnityEditor.Build.IPreprocessBuildWithReport bpp) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:376)
    13. UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List`1[T] oneInterfaces, System.Action`1[T] invocationOne, System.Collections.Generic.List`1[T] twoInterfaces, System.Action`1[T] invocationTwo, System.Boolean exitOnFailure) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:356)
    14. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    15.  
    Anyone have any suggestions on how to resolve?
    upload_2019-8-31_17-31-24.png

    Not doing any magic here. Literally pulling together the basics - ARFoundation + VFX Graph and trying to build to iOS.
    Thanks :)
     
  2. JeromeHinds

    JeromeHinds

    Joined:
    May 13, 2017
    Posts:
    1
    This is my first time posting. I'm normally watching from the sidelines but I'm getting tired of waiting for these fixes lol. So my fix for this until I figure out where to select the option of which xcode I want to use( Xcode10/ Xcode 11 beta) is to click on the error itself. Then scroll into the "LibUtil" class and replace the "SelectPlugin" function with this.

    {
    const BuildTarget platform = BuildTarget.iOS;
    var version = GetXcodeVersion();
    //if (version == new OSVersion(0))
    // throw new BuildFailedException($"Could not determine which version of Xcode was selected in the Build Settings. Xcode app was computed as {GetXcodeApplicationName()}.");

    //if (version >= new OSVersion(11))
    //{
    // libXcode10?.SetCompatibleWithPlatform(platform, false);
    // libXcode11?.SetCompatibleWithPlatform(platform, true);
    //}
    //else
    //{
    libXcode10?.SetCompatibleWithPlatform(platform, true);
    libXcode11?.SetCompatibleWithPlatform(platform, false);
    //}
    }



    Also if you are working with xcode11 beta. Replace the "SelectPlugin" with this function instead

    {
    const BuildTarget platform = BuildTarget.iOS;
    var version = GetXcodeVersion();
    //if (version == new OSVersion(0))
    // throw new BuildFailedException($"Could not determine which version of Xcode was selected in the Build Settings. Xcode app was computed as {GetXcodeApplicationName()}.");

    //if (version >= new OSVersion(11))
    //{
    libXcode10?.SetCompatibleWithPlatform(platform, false);
    libXcode11?.SetCompatibleWithPlatform(platform, true);
    //}
    //else
    //{
    // libXcode10?.SetCompatibleWithPlatform(platform, true);
    // libXcode11?.SetCompatibleWithPlatform(platform, false);
    //}
    }



    Again this is 100% not the correct way to do this. There should be an option in the playersetting I'm overlooking but till then this gets the job done. Good Luck:)
     
    AndreWiking21, PTW_AR and MaxXR like this.
  3. MaxXR

    MaxXR

    Joined:
    Jun 18, 2017
    Posts:
    67
    It works! Thanks Jerome :cool:
     
  4. Tarrag

    Tarrag

    Joined:
    Nov 7, 2016
    Posts:
    120
    Bump, very painful having to change this code every time we open Unity please. Is there a way to make the change permanent if in package?

    Very helpful @JeromeHinds , thanks
     
    Last edited: Sep 16, 2019
  5. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    40
  6. Tarrag

    Tarrag

    Joined:
    Nov 7, 2016
    Posts:
    120
  7. Iulian-Broasca

    Iulian-Broasca

    Joined:
    Jun 15, 2018
    Posts:
    1
    Hi,

    It worked when I commented lines 18 and 19 from LibUtil.cs :-D upload_2019-10-4_16-26-20.png
     
  8. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    543
    Cross posting from https://github.com/Unity-Technologies/arfoundation-samples/issues/313

    I assume you're building on a machine that does not have Xcode installed, e.g., a PC. This will be fixed in the next release. However, we still have to choose between Xcode 10 & 11, so on non-macOS platforms, it will choose Xcode 11. Does that work for you?

    Additionally, the solution mentioned in this thread of commenting out the lib selection will probably cause both libs to be included in the final build, which will lead to unexpected behavior. If you are going to modify LibUtil, you should uncomment one of the choices, e.g.,
    Code (csharp):
    1. libXcode10?.SetCompatibleWithPlatform(platform, false);
    2. libXcode11?.SetCompatibleWithPlatform(platform, true);
    For Xcode 11.
     
    JeromeHinds and Iulian-Broasca like this.
  9. Tarrag

    Tarrag

    Joined:
    Nov 7, 2016
    Posts:
    120
    that works for me with XCode 11.1 @tdmowrer