Search Unity

IOS OnPostProcessBuild Embedding Framework On Unity 5.6.x

Discussion in 'Editor & General Support' started by ernesb, May 19, 2018.

  1. ernesb

    ernesb

    Joined:
    Feb 12, 2017
    Posts:
    32
    Hi,

    Currently we're having problem on ios OnPostProcessBuild.
    Our third party that we use, recently released an update that use an editor extensions which only supported on Unity 2017.x. and up

    There are two lines that are problematic

    using UnityEditor.iOS.Xcode.Extensions; // This is not available on 5.6.5

    var projPath = Path.Combine(buildPath, "Unity-iPhone.xcodeproj/project.pbxproj");
    var project = new PBXProject();
    project.ReadFromString(File.ReadAllText(projPath));
    var target = project.TargetGuidByName("Unity-iPhone");
    var fileGuid = project.FindFileGuidByProjectPath("Frameworks/Plugins/iOS/SDKX.framework");

    project.AddFileToEmbedFrameworks(target, fileGuid); // This is not available on 5.6.5



    Both the Xcode.Extensions and AddFileToEmbedFrameworks is not available.
    From what I can tell from the code, it is trying to add framework file, say SDKX.framework, into the PBXProject.

    Can somebody point out any same code which have the same effect that would work on 5.6.5?

    We're still using unity 5.6.5p3 and currently updating Unity to 2017.x is not an option for us.
    There are probably things that are going to break (our other third party libs) by updating our Unity, this is a long project that has been developed using 5.6.5 from the beginning, and have been released and maintained on the store.

    Thank you very much for the help!
     
  2. ernesb

    ernesb

    Joined:
    Feb 12, 2017
    Posts:
    32
  3. Frankie-Lee

    Frankie-Lee

    Joined:
    Nov 28, 2013
    Posts:
    1
    Same problem. any workaround code / patch for Unity 5.x. Thanks.
     
  4. ernesb

    ernesb

    Joined:
    Feb 12, 2017
    Posts:
    32
  5. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,081
    Sorry for the silly question, but how to define the preprocessor UNITY_XCODE_API_BUILD?
     
  6. ernesb

    ernesb

    Joined:
    Feb 12, 2017
    Posts:
    32
    Go to File -> Build Settings -> Other Settings -> Scripting Define Symbols
    Put the UNITY_XCODE_API_BUILD preprocessor macro there
     
  7. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,081
    Thanks ermesb. Anyway, in order to make bitbucket xcodeapi to work, you DON't have to put UNITY_XCODE_API_BUILD preprocessor. This preprocessor is used to force Unity use the embedded Xcode API.
     
    Last edited: Jun 17, 2018