Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

iOS Build Error FileNotFoundException: Could not find file "/build/Libraries/RegisterMonoModules.h"

Discussion in '2019.3 Beta' started by Revolter, Aug 17, 2019.

  1. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    216
    Happens after importing Facebook SDK

    Reproduction is super simple:
    1. Create new project in Unity 2019.3.0a11
    2. Import latest Facebook SDK
    3. Build to iOS
     

    Attached Files:

    IgorAherne likes this.
  2. chanon81

    chanon81

    Joined:
    Oct 6, 2015
    Posts:
    168
    I have this same problem in Unity 2019.3.0b1
    Didn't know it was because of Facebook SDK

    Does anyone know if there is any progress to fixing this or any workarounds?
     
  3. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    216
    Submitted the bug both to Facebook and Unity, no updates from either of them
     
  4. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    216
    There is a workaround though, you can import the file manually in xcode (it's created in a wrong folder I think, or you can google for it)
     
  5. chanon81

    chanon81

    Joined:
    Oct 6, 2015
    Posts:
    168
    Thank you! I guess at least when 2019.3 is out of beta this should be fixed.
     
  6. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    This is an annoying Facebook.Unity.Editor bug that tries to find RegisterMonoModules.h file and modify it. I've spent a few hours until I figured out the silly solution.

    Just go into your unity installation folder, Editor/PlaybackEngines/iOSSupport/Trampoline/Libraries/
    You'll find RegisterMonoModules.cpp there but no .h file. Just create an empty .h file with that name. Done.

    That should work until facebook fixes it, which at the speed they do, it will probably be by 2021 or 2022
    (I've seen critical bug reports in there stay unsolved for 7 or 8 months, and all that was required was a simple // on a line and recompile).
     
    Last edited: Oct 20, 2019
  7. marcinzmijewski

    marcinzmijewski

    Joined:
    Feb 4, 2015
    Posts:
    11
    Anyone have any ideas how to fix that to build on Unity Cloud Build?
     
  8. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    yeah, asking facebook to fix the damn thing
     
  9. better_walk_away

    better_walk_away

    Joined:
    Jul 12, 2016
    Posts:
    291
    In my Unity installation folder, there is a RegisterMonoModules.h file in there, however, in my unity-exported xcode project folder, there is no RegisterMonoModules.h in the Libraries folder. I added a RegisterMonoModules.h to it, but when I rebuild the project, Unity deleted that file again, and the error persisted. So this workaround doesn't work for me. I saw this issue was on the issue tracker, but the conclusion was that it was a bug on the Facebook's side, not Unity. I am using Unity 2019.3.0f6 and Facebook SDK 7.18.0.
    I also had tried to comment up the "#include "RegisterMonoModules.h"" line in the FBUnityInterface.h file as other thread had mentioned, it didn't work for me either. The error was still the same.
    Currently, I am still trying to find workaround, or I will have to downgrade Unity.
     
    Last edited: Jan 29, 2020
  10. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    No, in your unity installation folder there is no such file. It's been removed for ages. Conclusion: you are looking at the wrong installation folder. Trust me on that.
     
    DaikiHirayama likes this.
  11. Plucky

    Plucky

    Joined:
    Mar 19, 2013
    Posts:
    1
    Great solution,thanks!
     
  12. assaf_hershko

    assaf_hershko

    Joined:
    May 20, 2017
    Posts:
    9
    In case it helps someone, unfortunately the above didn't fix it for me.
    Meaning, I added an empty RegisterMonoModules.h file to said directory, but archiving in Xcode still failed.

    What solved it for me was to wait for the archiving to fail, and then (in Xcode) simply comment the...
    #include "RegisterMonoModules.h"
    ... line and archive again.

    As a side note - I can't believe we need to find solutions for stuff like this on a forum, as opposed to Unity and/or Facebook fixing it.
     
  13. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    Well, yeah, it's 2 steps:
    1) Create an empty RegisterMonoModules.cpp in Editor/PlaybackEngines/iOSSupport/Trampoline/Libraries/
    2) In Xcode, compile the project and when it throws the error, remove the line
    #include "RegisterMonoModules.h"
    that is throwing you the error.

    In most cases you have to do both steps, because the xcode project generator will look for the file at Editor/PlaybackEngines/iOSSupport/Trampoline/Libraries/ and fail if it doesn't find it.
    And then xcode will fail to compile because the file is useless so you need to remove it manually from the code.


    I don't know how many months and it's not fixed on facebook side yet :/
     
  14. UniDro

    UniDro

    Joined:
    Nov 21, 2014
    Posts:
    25
    Facebook updated their SDK 23 days ago. Can someone confirm it still persists?
     
  15. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    216
    No more issues with latest version for me
     
  16. better_walk_away

    better_walk_away

    Joined:
    Jul 12, 2016
    Posts:
    291
    Yes, I am using Unity 2019.3.3f1 and Facebook SDK for Unity 7.18.1, it will still say that RegisterMonoModules.h is missing. And after adding an empty RegisterMonoModules.h file, the xcode will say that 'FBSDKShareKit/FBSDKShareKit.h' file not found‘ .
     
  17. better_walk_away

    better_walk_away

    Joined:
    Jul 12, 2016
    Posts:
    291
    Are we using different Unity version? I still have this issue in Unity 2019.3.3f1, what is your Unity version?
    I am using Facebook SDK for Unity 7.18.1, which is the latest.
     
  18. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    216
    Unity 2019.3.3f1 with Facebook SDK 7.18.1 - I am building through the Unity Cloud though.

    You can still fix the issue manually by removing any #import lines with RegisterMonoModules.h in the files inside FacebookSDK\SDK\Editor\iOS folder
     
  19. better_walk_away

    better_walk_away

    Joined:
    Jul 12, 2016
    Posts:
    291
    I found that my Unity 2019.3.3f1 didn't generate podfile and "Pods" folder. After adding RegisterMonoModules.h, another error appeared "FBSDKShareKit/FBSDKShareKit. h' file not found". FBSDKShareKit. h should be inside the "Pods" folder, but Unity didn't generate it.
    I have tested on a blank project with Unity 2019.3.3f1 and Facebook SDK 7.18.1, it did generate the podfile and "Pods" folder, and was built successfully. But my old project was upgraded from Unity 2018.4 to Unity 2019.3.3f1, it didn't generate the podfile and the "Pods" folder. I am still trying to resolve this issue.
     
  20. better_walk_away

    better_walk_away

    Joined:
    Jul 12, 2016
    Posts:
    291
    Yes, I finally fixed it! Just remove the "Library", ""Log", "Packages" and "ProjectSettings" folders in the root of the project, then reopen the project, let Unity recreate all that, build the game again, we should see the "Pods" folder finally generated in the xcode project.
     
  21. OleksandrMartysh

    OleksandrMartysh

    Joined:
    Dec 13, 2015
    Posts:
    25
    I had the same problem: "Could not find file "/build/Libraries/RegisterMonoModules.h". I had used Facebook SDK version 7.17.2 and Unity 2019.3.10f. In my case I have found this file was in directory /Applications/Unity/PlaybackEngines/iOSSupport/Trampoline. Firstly I have tried to copy it to Xcode project into "Libraries" folder. This action din't resolve the problem. After that I have tried to copy it deeper, into .../Libraries/VoodooPackages/TinySauce/VoodooAnalytics/FacebookSDK/SDK/Editor/iOS (yes, my Facebook SDK is just a part of Voodoo SDK, so path is such strange). This action is solved my problem.
     
    Deacon8 likes this.
  22. Charlessmith

    Charlessmith

    Joined:
    Oct 8, 2019
    Posts:
    2

    after doing this or manually adding the .h file at given location. build success but its throws exception and build crashes on start
     
  23. Ali_V_Quest

    Ali_V_Quest

    Joined:
    Aug 2, 2015
    Posts:
    138
    Any update on this ?
     
  24. Ali_V_Quest

    Ali_V_Quest

    Joined:
    Aug 2, 2015
    Posts:
    138
    I've had this problem with TinySauce from Voodoo & it was resolved after contacting their support & using their help
     
  25. alan_motionlab

    alan_motionlab

    Joined:
    Nov 27, 2014
    Posts:
    99
    What was the solution to fix it?
     
  26. RoverSquirrel

    RoverSquirrel

    Joined:
    Jun 8, 2013
    Posts:
    1
    Open your IOS Build on Xcode .

    Find the Libraries Folder.

    Create a new file named exactly 'RegisterMonoModules.h' under the Libraries Folder.
     
  27. alan_motionlab

    alan_motionlab

    Joined:
    Nov 27, 2014
    Posts:
    99

    Any way to do this without having the Xcode project? we use cloud build for everything? I guess wait for Facebook to fix itself?