skip to Main Content

On my Unity project, I took several builds before without a problem. However, in this build, I integrated Facebook SDK and then this error (image1) started appearing when I try to upload it after archiving it on the Xcode workspace.enter image description here

I also tried to upload it with Transporter, but Transporter also threw errors (image2).enter image description here

When I build the project for IOS unity creates some files and there I found a UnityFramework folder, I think this folder is the mentioned folder in the error. However, there are only 2 files in this folder and none is named "Frameworks"(image3).enter image description here

Here are the build options of the project at Xcode workspace (image4):enter image description here

With the Android build of the app, everything is okay. This issue appears only with the IOS build.

4

Answers


  1. Try to set the Always Embed Swift Standard Libraries. to No

    Login or Signup to reply.
  2. Yes, but Set the Always Embed Swift Standard Libraries in UnityFrameWork Build Settings, not in main app’s Build Settings. That worked for me.

    Login or Signup to reply.
  3. Changing the "Always Embed Swift Standard Libraries" value to "No" in the UnityFramework’s build settings solved this issue for me.

    Targets > UnityFramework > Build Settings > Always Embed Swift Standard Libraries > No

    Login or Signup to reply.
  4. Here’s a visual representation of what you should do to resolve the "contains disallowed file 'Frameworks'" errors in XCode projects exported from Unity

    enter image description here

    1. Click on Unity-iPhone project
    2. Click on the UnityFramework Target
    3. Click on the Build Settings
    4. Search for "swift"
    5. Set the "Always Embed Swift Standard Libraries" option to "No"
    • IMPORTANT Remember to change the build settings of the "UnityFramework" target NOT the "Unity-iPhone" target

    Or

    If you don’t want to configure this manually every time you build you can add this script in your project to do it automatically for you on each build:

    using System;
    using UnityEditor;
    #if UNITY_IOS
    using UnityEditor.iOS.Xcode;
    #endif
    using UnityEditor.Callbacks;
    
    namespace SomeEditorNameSpace
    {
        // Automatically set the "Always Embed Swift Standard Libraries" option to "No" in UnityFramework Target in XCode
        public static class DisableEmbedSwiftLibs
        {
            [PostProcessBuildAttribute(Int32.MaxValue)] //We want this code to run last!
            public static void OnPostProcessBuild(BuildTarget buildTarget, string pathToBuildProject)
            {
                #if UNITY_IOS
                if (buildTarget != BuildTarget.iOS) return; // Make sure its iOS build
                
                // Getting access to the xcode project file
                string projectPath = pathToBuildProject + "/Unity-iPhone.xcodeproj/project.pbxproj";
                PBXProject pbxProject = new PBXProject();
                pbxProject.ReadFromFile(projectPath);
                
                // Getting the UnityFramework Target and changing build settings
                string target = pbxProject.GetUnityFrameworkTargetGuid();
                pbxProject.SetBuildProperty(target, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "NO");
    
                // After we're done editing the build settings we save it 
                pbxProject.WriteToFile(projectPath);
                #endif
            }
        }
    }
    

    Then you can Archive & Validate your build without any errors. Hope my answer helped.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search