Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity 2019.3.0f6 - iOS Launch Crash "UnityFramework.framework" not found

Discussion in 'iOS and tvOS' started by Spectra_7, Feb 28, 2020.

  1. Spectra_7

    Spectra_7

    Joined:
    Oct 17, 2017
    Posts:
    33
    I get no errors when building the project from xCode.

    But the game crashes at launch leaving this much message:

    Code (CSharp):
    1. 2020-02-28 18:49:21.622768+0530 shredder[1257:304303] Error loading /var/containers/Bundle/Application/728E4B97-C4EF-45CE-AF95-FB3C751D5EAC/shredder.app/Frameworks/UnityFramework.framework/UnityFramework:  dlopen(/var/containers/Bundle/Application/728E4B97-C4EF-45CE-AF95-FB3C751D5EAC/shredder.app/Frameworks/UnityFramework.framework/UnityFramework, 265): Library not loaded: @rpath/libswiftCore.dylib
    2.  
    3.   Referenced from: /var/containers/Bundle/Application/728E4B97-C4EF-45CE-AF95-FB3C751D5EAC/shredder.app/Frameworks/UnityFramework.framework/UnityFramework
    4.  
    5.   Reason: image not found
    "UnityFramework.framework" is added in the "Embed Frameworks" list of xCode. I never had such issues in previous version. All this started to happen after I upgraded to Unity 2019.3.0f6 version.
     
  2. HWDKoblenz

    HWDKoblenz

    Joined:
    Apr 3, 2017
    Posts:
    19
    Hi, are you using a personal Apple developer Account and your iOS 13.3.1?
     
  3. Spectra_7

    Spectra_7

    Joined:
    Oct 17, 2017
    Posts:
    33
    Yes, I am using Developer Account, but iOS is 12.1
     
  4. HWDKoblenz

    HWDKoblenz

    Joined:
    Apr 3, 2017
    Posts:
    19
    Ah okay this is weird. I only know this problem using iOS 13.3.1. There is a problem to run an app with a personal developer account, because there is an problem with using the dynamic unity framework. I sometimes also get some strange errors in Xcode. All I do is closing Unity and Xcode, delete the build folder, start unity again and start a new build. It helps in most cases :-D.
     
    leni8ec and torsigurdson like this.
  5. Spectra_7

    Spectra_7

    Joined:
    Oct 17, 2017
    Posts:
    33
    So... any solution found?
     
  6. FranFndz

    FranFndz

    Joined:
    Sep 20, 2018
    Posts:
    178
    wanna know too
     
  7. michaelhill

    michaelhill

    Joined:
    Nov 4, 2015
    Posts:
    11
    I am also struggling with this problem. I'm on iOS 13.3.1, Unity 2019.3.5.f1, macOS 10.15.3, and Xcode 11.3.1 using a paid developer accounts for both Apple and Unity.
     
    mirovalent likes this.
  8. FranFndz

    FranFndz

    Joined:
    Sep 20, 2018
    Posts:
    178
    i gave up
     
  9. liamhaliday

    liamhaliday

    Joined:
    Aug 21, 2018
    Posts:
    1
    marius_87 likes this.
  10. qmpaden

    qmpaden

    Joined:
    Feb 2, 2019
    Posts:
    9
    IOS build not working with almost all Unity versions now due to Apple's new launch screen restriction and sudden depreciation of all previous app Splash screens is really really really bad for mobile developers, like insanely incredibly bad.

    I really hope for a fast fix from Unity, as of today due to this new set of Apple launchscreen requirements you can't build on IOS anymore quickly like before in Unity without digging deep into XCODE after every single build to manually create, specifically link, and compile bundle assets and a launchscreen.storyboard asset.

    For Mobile developers like me who are new to XCODE, but not new to Unity, this is a terrifying and scary time.

    This error happens to me as well. I cannot build in 2019.4 LTS below due to Launchscreen.storyboard errors and with all 2020 versions my builds fail due to unity framwork error with the new metal implementation on older 2018 mac machines.

    Due to Apple splashscreen depriciation unity ios builds 2019.4 and other versions now do not work. Right now all Unity Developers cannot submit updates in IOS due to Apple's strict new Launchscreen.storyboard requirements for all apps destroying Unitys previous ios build system.

    At the moment unity does not build ios apps with launch screens by default even when going into Player Settings and adding the custom storyboard into your assets with storyboard images in streamingassets folder with post build scripts, instead the build crashes on launch with SplashScreen.mm giving errors and builds structure keeps defaulting to linking depreciated SpashScreen.mm unity ios launch logo implementation and not new xcode custom Launchscreen.storyboard in 2019.4 LTS and below.
     
  11. martingonzalezetermax

    martingonzalezetermax

    Joined:
    Dec 11, 2017
    Posts:
    24
    2019.4.2 still happening.

    But if I build a new project iOS works. :/
     
    Last edited: Jul 4, 2020
  12. martingonzalezetermax

    martingonzalezetermax

    Joined:
    Dec 11, 2017
    Posts:
    24
  13. martingonzalezetermax

    martingonzalezetermax

    Joined:
    Dec 11, 2017
    Posts:
    24
    * I've tried exporting an Adhoc version of the app and it crashes.
    * I revoked certificates and try creating them again and it crashes.
    * I've exported the .ipa and see it content and UnityFramework seems to be there.

    Any Unity staff that can guide us?


    upload_2020-7-5_21-45-39.png
     
  14. BitbotUG

    BitbotUG

    Joined:
    Nov 9, 2019
    Posts:
    2
    HI, I had the same issue with 2019.3.2 and after creating a new project and importing all my stuff in 2019.4.2f it stays the same. My error message is slightly different: "Error loading ... /io.app/UnityFramework.framework/UnityFramework ...". I am using Xcode 11.4.

    Do you have any extensions installed ? Maybe there is an issue. I am using Appodeal, Remote Config, Lightweight RP and some 2D stuff.

    ***Android build is successfull (f*** ios)
     
    GiosifusDev likes this.
  15. BitbotUG

    BitbotUG

    Joined:
    Nov 9, 2019
    Posts:
    2
    The great Appodeal support helped me with this solution:

    I had to embed the required frameworks (under Pods -> Products) in my target (Target -> BuildPhases -> Embed Frameworks).
     

    Attached Files:

  16. Lejv

    Lejv

    Joined:
    Nov 19, 2014
    Posts:
    7
    Hi, I still have this issue - has someone found a fix please?
     
  17. s1m0n1stv4n

    s1m0n1stv4n

    Joined:
    Sep 14, 2012
    Posts:
    16
  18. rudranshjio123

    rudranshjio123

    Joined:
    Jul 29, 2020
    Posts:
    1
    error.PNG
    please help me with this
     
    unity_HmmVk7bClEAtyA likes this.
  19. Lejv

    Lejv

    Joined:
    Nov 19, 2014
    Posts:
    7
  20. MaximPP

    MaximPP

    Joined:
    Jan 26, 2019
    Posts:
    76
    Hi! I have the same issue. Adding the "EMBEDDED_CONTENT_CONTAINS_SWIFT" flag to xCode does help, but how do I add it via Unity? This problem started after updating the FB sdk.
     
  21. MaximPP

    MaximPP

    Joined:
    Jan 26, 2019
    Posts:
    76
  22. triplume

    triplume

    Joined:
    Aug 12, 2020
    Posts:
    1
    This answer worked for me.

    Thank you.
     
  23. BigRedGames

    BigRedGames

    Joined:
    Jun 25, 2016
    Posts:
    48
    None of the solutions above worked for me, but I found on the same forum mentioned before this solution https://stackoverflow.com/a/69852407/9061358

    My problem started after updating the Mac OS to Monterey, but I'm not sure that it was the cause of the issue.
     
    masterton likes this.
  24. masterton

    masterton

    Joined:
    Dec 11, 2012
    Posts:
    41
    I spent forever looking at the problem, thinking it was UnityFramework that was missing or not loading or something but if you look at OP's output (and my error output was almost exactly the same), in true, confusing as all heck, iOS style it is that UnityFramework is trying to load a dynamic library called libswiftCore.dylib and its the libswiftCore.dylib thats not found.

    But I already set embed frameworks to YES, surely that would fix it? Nope, same error (to be clear these are runtime errors, not compile or linker or validation errors).

    As in @BigRedGames link above, you need to add /usr/lib/swift to the Runtime Search Path in xcode, and it has to be the first entry.

    Why wouldn't it automatically be added when you embed the frameworks? What's the point of embedding the frameworks at all? Only Cupertino knows.
     
  25. sandolkakos

    sandolkakos

    Joined:
    Jun 3, 2009
    Posts:
    282
    For me, the problem was solved only after I set the "Provisioning Profile" also in the Signing of the UnityFramework target.

    I was setting the "Provisioning profile" only in the "Unity-Project" target. The build was finishing but when opening the App, it instantly was crashing with the "Library not loaded" error.
     
  26. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    How did you do that ? I'm not familiar with ios sorry
     
  27. sandolkakos

    sandolkakos

    Joined:
    Jun 3, 2009
    Posts:
    282
    You need to set the `Prov Profile` both in the `Unity-iPhone` and `UnityFramework` targets:
    upload_2023-3-30_22-19-48.png
     
  28. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    Damn, thanks for the answer, I do my builds with unity cloud build, would it be possible to do that here ? I believe that's on unity team's hands
     
  29. sandolkakos

    sandolkakos

    Joined:
    Jun 3, 2009
    Posts:
    282
    I'm not sure how it works there. The last time I used Unity Cloud build was in 2018 :(
    But you can try to create Post Process Build logic to change whatever you want in the Xcode project:
    - https://docs.unity3d.com/ScriptReference/Callbacks.PostProcessBuildAttribute.html
     
    rbitard likes this.
  30. d_sharov

    d_sharov

    Joined:
    Dec 24, 2021
    Posts:
    23
    Unfortunately, this option did not work for us.
    Build via Cloud
    Used 2 options.

    Code (CSharp):
    1. [PostProcessBuild(999)]
    2.         public static void OnPostProcessBuild(BuildTarget target, string path)
    3.         {
    4.             if (target != BuildTarget.iOS)
    5.                 return;
    6.  
    7.             try
    8.             {
    9.                 Debug.Log($"{nameof(ModifyFrameworksPostProcess)} Start Post Process Build");
    10.                 var projPath = PBXProject.GetPBXProjectPath(path);
    11.                 Debug.Log($"{nameof(projPath)}: {projPath}");
    12.  
    13.                 var project = new PBXProject();
    14.                 project.ReadFromFile(projPath);
    15.  
    16.                 Debug.Log($"{nameof(ModifyFrameworksPostProcess)} Project successfully initialized");
    17.  
    18.  
    19.                 project.EnableContentContainsSwift();
    20.                 project.SetProvisioningProfile();
    21.                 project.WriteToFile(projPath);
    22.  
    23.                 Debug.Log($"{nameof(ModifyFrameworksPostProcess)} End success Post Process Build");
    24.             }
    25.             catch (Exception e)
    26.             {
    27.                 Debug.LogError(
    28.                     $"{nameof(ModifyFrameworksPostProcess)} End failed Post Process Build. Message: {e.Message}");
    29.                 Debug.LogException(e);
    30.                 throw;
    31.             }
    32.         }
    33.  
    34.     private static void SetProvisioningProfile(this PBXProject project)
    35.         {
    36.             var unityFrameworkTarget = project.GetUnityFrameworkTargetGuid();
    37.             var provisioningProfileId = ""; // your id
    38.             project.SetBuildProperty(unityFrameworkTarget, "PROVISIONING_PROFILE_SPECIFIER", provisioningProfileId);
    39.             project.SetBuildProperty(unityFrameworkTarget, "CODE_SIGN_STYLE", "Manual");
    40.             project.SetBuildProperty(unityFrameworkTarget, "CODE_SIGN_IDENTITY", "iPhone Distribution");
    41.  
    42.             Debug.Log($"{nameof(ModifyFrameworksPostProcess)} {nameof(SetProvisioningProfile)} end");
    43.         }
    44.  
    45. private static void EnableContentContainsSwift(this PBXProject project)
    46.         {
    47.             var target = project.GetUnityFrameworkTargetGuid();
    48.             project.SetBuildProperty(target, "EMBEDDED_CONTENT_CONTAINS_SWIFT", "YES");
    49.             Debug.Log($"{nameof(ModifyFrameworksPostProcess)} {nameof(EnableContentContainsSwift)} end");
    50.         }
     
  31. sandolkakos

    sandolkakos

    Joined:
    Jun 3, 2009
    Posts:
    282
    Does that code work for you when building the Xcode project locally?
    That is the better approach in my opinion, trying it first locally until you have the same result you expect to go your Build Services.
     
  32. pichikala

    pichikala

    Joined:
    Sep 18, 2021
    Posts:
    5
    I spent two days figuring out how to make Unity LevelPlay work with IronSource, and here's what worked for me. I had to combine three methods that I found on the forum.

    1. Disable BitCode by using the following code in Scripts/Editor/BitCodeHelperRevised.cs (huge thanks to @firesightstudios):
      Code (CSharp):
      1. #if UNITY_IOS
      2.  
      3. using UnityEditor;
      4. using UnityEditor.Callbacks;
      5. using UnityEditor.iOS.Xcode;
      6.  
      7. public static class BitCodeHelperRevised
      8. {
      9.     [PostProcessBuild(1000)]
      10.     public static void PostProcessBuildAttribute(BuildTarget target, string pathToBuildProject)
      11.     {
      12.         if (target != BuildTarget.iOS) return;
      13.  
      14.         var projectPath = PBXProject.GetPBXProjectPath(pathToBuildProject);
      15.  
      16.         var pbxProject = new PBXProject();
      17.         pbxProject.ReadFromFile(projectPath);
      18.  
      19.         var targetGuids = new[] { pbxProject.GetUnityMainTargetGuid(), pbxProject.GetUnityFrameworkTargetGuid() };
      20.         pbxProject.SetBuildProperty(targetGuids, "ENABLE_BITCODE", "NO");
      21.         pbxProject.WriteToFile(projectPath);
      22.     }
      23. }
      24. #endif
    2. After building in Unity, open Unity-iPhone.xcworkspace (I used to open Unity-iPhone.xcodeproj and didn't know why it wasn't working anymore, so it's important to note that you now need to run the workspace).
    3. Ensure that nothing is using BitCode. Click on 'Unity-iPhone' in the left menu, then check every target and the Project. You can check this by clicking "Build Settings" in the menu and searching for "enable bitcode." If you see something using bitcode (true), change it to false.
    4. After checking every target, click on 'Pods' in the left menu and do the same (check if all bitcodes are set to false).
    5. Select 'Unity-iPhone' in the left menu, click on 'UnityFramework' under targets, then click on Build Settings and search for "library search path." Add the following:
      Code (CSharp):
      1. $(SDKROOT)/usr/lib/swift
      Code (CSharp):
      1. $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
      Huge thanks to @ImYuta for this tip.
    6. Search for "Runpath Search Path" in the same place (UnityFramework -> Build Settings) and add this line:
      Code (CSharp):
      1. /usr/lib/swift
      Then drag it to the top of the list. Thanks to @masterton for this advice.

    That's it! I hope this helps!

    Worked for me on:
    Unity 2021.3.24f
    XCode 14.1
     
    qball13z likes this.
  33. yashubhati

    yashubhati

    Joined:
    Mar 28, 2017
    Posts:
    8
    Error loading /var/containers/Bundle/Application/42297171-D975-452C-83FB-9675EFA79944/Football World.app/Frameworks/UnityFramework.framework/UnityFramework (141): dlopen(/var/containers/Bundle/Application/42297171-D975-452C-83FB-9675EFA79944/Football World.app/Frameworks/UnityFramework.framework/UnityFramework, 0x0109): Library not loaded: @rpath/FBAEMKit.framework/FBAEMKit


    can any one help me with this ? I am getting this error after the app launches on iPhone.
     
  34. sandolkakos

    sandolkakos

    Joined:
    Jun 3, 2009
    Posts:
    282
    Check if that is also your case: