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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Xcode build Error : 'UnityFramework/UnityFramework.h' file not found

Discussion in 'iOS and tvOS' started by U_Raizada, Mar 1, 2020.

  1. U_Raizada

    U_Raizada

    Joined:
    Feb 21, 2020
    Posts:
    1
    When I am trying to build the Xcode project, it is saying that my main.mm can not find the UnityFramework.h file. Which I checked is not missing in the Project. Can anyone give me some advice on what to do?
    Screenshot 2020-03-01 at 3.52.53 PM.png
     
  2. austerlitz10

    austerlitz10

    Joined:
    Aug 22, 2016
    Posts:
    3
    I have the same error. Not sure what to do.
     
  3. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    360
    This is known issue with Helpshift plugin (and with all plugins that use OLD mod_pbxproj). You can fix this by modifying mod_pbxproj.py file by adding
    Code (CSharp):
    1. ('PBXHeadersBuildPhase', True),
    to line 1349 (or near it, depending about the mod_pbxproj version)
     
    MagicMiikka and austerlitz10 like this.
  4. Kaiymu_

    Kaiymu_

    Joined:
    Jun 1, 2016
    Posts:
    47
    Hello everyone,

    I don't have any mod_pbxproj.py in my project, so I have to update the main.mm manually. Is there any other way to change that ? (I just update the path so!)

    Thank you !
     
  5. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    360
    You can create post process script that modifies the file manually. Something like
    Code (CSharp):
    1.  
    2.     [PostProcessBuild]
    3.     public static void ChangeXcodePlist(BuildTarget buildTarget, string path)
    4.     {
    5.         if (buildTarget == BuildTarget.iOS)
    6.         {
    7.             // Ugly fix for missing UnityFramework.h Xcode issue
    8.             string mainAppPath = Path.Combine(path, "MainApp", "main.mm");
    9.             string mainContent = File.ReadAllText(mainAppPath);
    10.             UnityEngine.Debug.Log(mainContent);
    11.             string newContent = mainContent.Replace("#include <UnityFramework/UnityFramework.h>", @"#include ""../UnityFramework/UnityFramework.h""");
    12.             File.WriteAllText(mainAppPath, newContent)
    13.          }
    14. }
    15.  
     
    sarebots2, il-k-goto, sang and 2 others like this.
  6. Kaiymu_

    Kaiymu_

    Joined:
    Jun 1, 2016
    Posts:
    47
    Hello Kaarloew !
    Thanks for the reply :).

    I don't have access to my mac OS machine, but I'm totally going to do that! I started modifying the file by hand and I was close the getting it to work!

    Thank you for your help!
     
  7. YHX2000

    YHX2000

    Joined:
    Aug 2, 2015
    Posts:
    29
    Hello @kaarloew where I can read more info how to implement such script in my unity project ? I mean is it just writing script and then I run build in Unity ?
     
  8. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    360
    YHX2000 likes this.
  9. KimLysgaardAndersen

    KimLysgaardAndersen

    Joined:
    Jul 4, 2016
    Posts:
    2
    I have the same error. It started after I cleaned the project in xcode. I have spent all day on that error please help!!! :)
     
  10. KimLysgaardAndersen

    KimLysgaardAndersen

    Joined:
    Jul 4, 2016
    Posts:
    2
    Ok I finally got it! You can change the code in main.mm by hand. I changed it from <UnityFramwork/UnityFramwork.h> To "../UnityFramwork/UnityFramwork.h"
     
  11. kunalxigxag

    kunalxigxag

    Joined:
    Aug 7, 2014
    Posts:
    9
    Dude, its framework not framwork -
    Code (CSharp):
    1. #include "../UnityFramework/UnityFramework.h"
     
    sarebots2 likes this.
  12. Danoli3

    Danoli3

    Joined:
    Sep 12, 2017
    Posts:
    14
    Dude, UnityFramwork for days.

     
  13. christianlong99

    christianlong99

    Joined:
    Aug 20, 2018
    Posts:
    3
    This worked for me!! After 9-10 hours of searching for a solution to this error: 'defines.h' file not found
    Probably will use the post process script for new builds, but changing the main.mm file in xcode was simple enough to test it.
     
    Christin2015 likes this.
  14. MaxAtEclipse

    MaxAtEclipse

    Joined:
    Feb 25, 2020
    Posts:
    6
    I can't explain exactly why this happened, nor why my solution worked, but I found that in my Products folder, there were multiple folders. One was "ReleaseForRunning-iphoneos" - that's the one from which Xcode was building. That one didn't contain the UnityFramework folder, but another - "ReleaseForRunning-iphonesimulator" did. I copied that folder over (it's all for the same app after all, right?) and the build succeeded.
     
  15. bigbrainz

    bigbrainz

    Joined:
    Jul 21, 2015
    Posts:
    175
    After fiddling with this same problem for an hour or two, I solved by just clearing the build folder. o_O
     
  16. robin_pcity

    robin_pcity

    Joined:
    Jun 26, 2020
    Posts:
    28
    where is this file located?
     
  17. Sai_Nishanth

    Sai_Nishanth

    Joined:
    Dec 8, 2022
    Posts:
    1
    After fixing this issue I have another issue with unityappcontroller.h file is not found.
     
  18. 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