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 Achive Error : 'UnityFramework/UnityFramework.h' file not found

Discussion in 'iOS and tvOS' started by MuuM, May 11, 2020.

  1. MuuM

    MuuM

    Joined:
    Aug 4, 2017
    Posts:
    4
    Xcode Achive Error : 'UnityFramework/UnityFramework.h' file not found
    But the build was successful
    Here is a workspace which contains a master project, a pods, and a unity(Unity2019.3.11) export project. The master project can be run, but this error was reported when we were archived! Hope the big gods help to see! Thank you very much!
     

    Attached Files:

  2. NicTda

    NicTda

    Joined:
    Jan 11, 2018
    Posts:
    19
    Had the same issue, and found the solution on another thread (can't remember where):

    Change the line
    #include <UnityFramework/UnityFramework.h>
    to
    "../UnityFramework/UnityFramework.h"

    That should allow you to archive your build. To automate this process, add a post process build function.
    Here's mine (iOSPostBuildProcessor.cs to place in Editor/ folder):
    Code (CSharp):
    1. using UnityEditor;
    2. using UnityEditor.Callbacks;
    3. using System.IO;
    4. using UnityEditor.iOS.Xcode;
    5.  
    6. public class iOSPostBuildProcessor
    7. {
    8.     [PostProcessBuild]
    9.     public static void ChangeXcodeSettings(BuildTarget buildTarget, string pathToBuiltProject)
    10.     {
    11.         if (buildTarget == BuildTarget.iOS)
    12.         {
    13.             // Fix for missing UnityFramework.h Xcode issue
    14.             string mainAppPath = Path.Combine(pathToBuiltProject, "MainApp", "main.mm");
    15.             string mainContent = File.ReadAllText(mainAppPath);
    16.             string newContent = mainContent.Replace("#include <UnityFramework/UnityFramework.h>", @"#include ""../UnityFramework/UnityFramework.h""");
    17.             File.WriteAllText(mainAppPath, newContent);
    18.         }
    19.     }
    20. }
    Edit: found where I found the solution:
    https://forum.unity.com/threads/xco...amework-h-file-not-found.838318/#post-5585173
     
    Last edited: May 12, 2020
  3. arpanmehtaevontech

    arpanmehtaevontech

    Joined:
    Feb 28, 2023
    Posts:
    3
    i am getting this error while include this ->
    #include <UnityFramework/UnityFramework.h>

    Error ->UnityFramework/UnityFramework.h' file not found..

    Please Help me out