Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

2019.3 - validation on upload to store gives "UnityFramework.framework contains disallowed file"

Discussion in 'iOS and tvOS' started by Firewalker, Sep 26, 2019.

  1. Firewalker

    Firewalker

    Joined:
    Mar 30, 2012
    Posts:
    39
    App runs on phone normally.
    When trying to validate the app before uploading it to the store, this comes out:

    Invalid Bundle. The bundle at 'my.app/Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks'

    Unity 2019.3 Xcode 10.2

    Help?
     
  2. PavelLU

    PavelLU

    Unity Technologies

    Joined:
    Feb 23, 2017
    Posts:
    108
  3. Dover8

    Dover8

    Joined:
    Aug 20, 2010
    Posts:
    94
    @Firewalker did you have any luck with this? I'm hitting the same issue.
     
    bettywhite likes this.
  4. Wiwo

    Wiwo

    Joined:
    Oct 15, 2012
    Posts:
    2
    I have the same problem with Unity 2019.3.0f3 and Xcode 11.3. When I try to validate the app in the App Store, it gives me this error:

    App Store Connect Operation Error
    Invalid Bundle. The bundle at 'my_app_name.app/Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks'.

    I could not find a solution yet.
     
    Last edited: Dec 28, 2019
    bettywhite likes this.
  5. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    516
    Can any one of you post a detailed folder structure of that UnityFramework.framework bundle you have issues with?

    This error message could mean that there is embedded frameworks inside UnityFramework.framework. This may be an umbrella framework situation which Apple discourages.
     
  6. Wiwo

    Wiwo

    Joined:
    Oct 15, 2012
    Posts:
    2
    It only had a .h file and a .plist file. I supose it must be some configuration option the one that gives troubles.

    But I managed to send the app using the previous version of Unity (2019.2).
     
  7. Dover8

    Dover8

    Joined:
    Aug 20, 2010
    Posts:
    94
    The UnityFramework is only added in the 2019.3 builds. It seems to be a framework library that then holds all the usual frameworks have always been added to the main target.

    This seems to have been a design decision for 2019.3 - but not one that Apple seems to agree with!

    2019.2 build structure
    Unity 2019.2 build.png

    2019.3 build structure Unity 2019.3 build.png
     
  8. msp_

    msp_

    Joined:
    Jul 26, 2019
    Posts:
    4
    I'm hitting this too!

    @Dover8 - did you find a solution without downgrading Unity?
     
  9. msp_

    msp_

    Joined:
    Jul 26, 2019
    Posts:
    4
  10. XargonInSpace

    XargonInSpace

    Joined:
    Nov 5, 2018
    Posts:
    4
  11. konhoe

    konhoe

    Joined:
    Mar 17, 2015
    Posts:
    1
    This seems to still be a problem with 2019.3.10f. Reverting to 2019.2. was the only solution

    Im using Vuforia and Mapbox so maybe one of these libraries cause this in the first place.
     
    WorccoArts likes this.
  12. WorccoArts

    WorccoArts

    Joined:
    Jan 22, 2020
    Posts:
    1
    Hello Thanks to all for info.

    Solution: reverting from 2019.3 to 2019.2. worked for me.
     
  13. andycampbell92

    andycampbell92

    Joined:
    Mar 7, 2020
    Posts:
    2
    I can confirm the same issue on 2019.03.12f1.

    Unfortunately since I ceated my project in 2019.03 originally downgrading is a real mess....
     
  14. andycampbell92

    andycampbell92

    Joined:
    Mar 7, 2020
    Posts:
    2
    InglewoodTechnology likes this.
  15. scraft_vtime

    scraft_vtime

    Joined:
    Jan 16, 2019
    Posts:
    11
    Setting

    Always Embed Swift Standard Libraries

    To 'NO' for the main app, UnityFramework and app extension (in my case keyboard extension) fixed this issue for me. I did this in code via:

    Code (CSharp):
    1. pbxProject.SetBuildProperty(target, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "NO");
     
  16. Qhuhuit

    Qhuhuit

    Joined:
    Feb 17, 2018
    Posts:
    39
    Where did you put this code ? Can it be used with Unity Cloud Build ?
    Is the pre/post export method & pre/post build script area a place to look for ? I've never use it before, any guidance will be appreciated :)
     
  17. AliBuck

    AliBuck

    Joined:
    Aug 22, 2020
    Posts:
    31
    Last edited: Sep 29, 2020
    Starbox, metalanca, Stader and 10 others like this.
  18. Amorino

    Amorino

    Joined:
    Jul 11, 2013
    Posts:
    4
    You can use the following script to delete on each compilation the folder mentioned above.
    Code (CSharp):
    1. cd "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Frameworks/UnityFramework.framework/"
    2. if [[ -d "Frameworks" ]]; then
    3.     rm -fr Frameworks
    4. fi
     
    Last edited: Oct 15, 2020
  19. z741092665

    z741092665

    Joined:
    Jun 14, 2017
    Posts:
    2
  20. jetdogsoy

    jetdogsoy

    Joined:
    Nov 28, 2017
    Posts:
    1
    In my case it helped to move all dylibs from UnityFramework.framework/Frameworks to Frameworks root in archive after build. And delete UnityFramework.framework/Frameworks also there.
     
  21. xLeo

    xLeo

    Joined:
    Sep 21, 2010
    Posts:
    197
    I suppose this script works for UCB builds, right?
    Trying this one right now.
     
  22. boorch

    boorch

    Joined:
    Oct 7, 2015
    Posts:
    40
  23. xLeo

    xLeo

    Joined:
    Sep 21, 2010
    Posts:
    197
    So, we are having this issue on our Unity 2020.1 Cloud Build that automatically tries to upload to the store.

    We iterate upon our exported project directories and try to find (and delete) nested "Frameworks" files or directories in "*.framework" directories.

    Turns out that there's no "UnityFramework.framework" at this moment on the directory.
    Is that directory download or generated during XCode build?

    How can we fix this on Unity Cloud Build builds?



    This is our current Post-Export Method:
    Code (CSharp):
    1. public static void SearchInvalidFrameworksDirectoryAndDelete(string basePath)
    2.         {
    3.             Debug.LogFormat("[SearchInvalidFrameworksDirectoryAndDelete] Platform: {0}; Base Path: {1}",
    4.                 Application.platform, basePath);
    5.          
    6.             string[] frameworkDirectories = Directory.GetDirectories(basePath, "*.framework", SearchOption.AllDirectories);
    7.             for (int i = 0; i < frameworkDirectories.Length; i++)
    8.             {
    9.                 string unityFrameworkPath = frameworkDirectories[i];
    10.              
    11.                 Debug.LogFormat("[SearchInvalidFrameworksDirectoryAndDelete] Looking up for invalid \"Frameworks\" directory or file at path: {0}", unityFrameworkPath);
    12.              
    13.                 string[] nestedFrameworksDirectories = Directory.GetDirectories(unityFrameworkPath, "Frameworks", SearchOption.AllDirectories);
    14.                 foreach (string nestedFrameworkDirectory in nestedFrameworksDirectories)
    15.                 {
    16.                     Debug.LogWarningFormat("[SearchInvalidFrameworksDirectoryAndDelete] Deleting DIRECTORY: {0}", nestedFrameworkDirectory);
    17.                     Directory.Delete(nestedFrameworkDirectory, true);
    18.                 }
    19.  
    20.                 string[] nestedFrameworksFiles = Directory.GetFiles(unityFrameworkPath, "Frameworks", SearchOption.AllDirectories);
    21.                 foreach (string nestedFrameworksFile in nestedFrameworksFiles)
    22.                 {
    23.                     Debug.LogWarningFormat("[SearchInvalidFrameworksDirectoryAndDelete] Deleting FILE at path: {0}", nestedFrameworksFile);
    24.                     File.Delete(nestedFrameworksFile);
    25.                 }
    26.             }
    27.         }
     
  24. Martin_Gonzalez

    Martin_Gonzalez

    Joined:
    Mar 25, 2012
    Posts:
    361
    How can I add UnityFramework.framework to Link Binary with Libraries?
    Unity crashes because watchdog in iOS and adding it manual there prevents the crash
     
    ina likes this.
  25. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,095
  26. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,095
  27. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,759
    This is still a bug on Unity 2021 beta 8
     
    mcarriere likes this.
  28. unity_Iu70XvRN7XIS4g

    unity_Iu70XvRN7XIS4g

    Joined:
    Nov 13, 2020
    Posts:
    2
    Found solution. Add script below to Editor folder.

    Code (CSharp):
    1. using System.IO;
    2. using UnityEditor;
    3. using UnityEditor.Callbacks;
    4. using UnityEditor.iOS.Xcode;
    5.  
    6. namespace Editor
    7. {
    8.     public static class XcodeSwiftVersionPostProcess
    9.     {
    10.         [PostProcessBuild(999)]
    11.         public static void OnPostProcessBuild(BuildTarget buildTarget, string path)
    12.         {
    13.             if (buildTarget == BuildTarget.iOS)
    14.             {
    15.                 ModifyFrameworks(path);
    16.             }
    17.         }
    18.  
    19.         private static void ModifyFrameworks(string path)
    20.         {
    21.             string projPath = PBXProject.GetPBXProjectPath(path);
    22.            
    23.             var project = new PBXProject();
    24.             project.ReadFromFile(projPath);
    25.  
    26.             string mainTargetGuid = project.GetUnityMainTargetGuid();
    27.            
    28.             foreach (var targetGuid in new[] { mainTargetGuid, project.GetUnityFrameworkTargetGuid() })
    29.             {
    30.                 project.SetBuildProperty(targetGuid, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "NO");
    31.             }
    32.            
    33.             project.SetBuildProperty(mainTargetGuid, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "YES");
    34.  
    35.             project.WriteToFile(projPath);
    36.         }
    37.     }
    38. }
    39.  
     
    Its4u, SKGowrob, SpiderJones and 13 others like this.
  29. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,759
    yeah but we shouldn´t have to do work arounds, by default we should be able to submit projects to the store
     
    petey, FVS, Polyfemos and 1 other person like this.
  30. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    Yes, unbelievable that this is still active.

    On Unity 2019.4.24f1 ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES is set to No for Unity-iPhone and UnityFramework. If you build like this your app will crash on some devices, just tested on Simulator, iPad Pro 9.7-inch, 10.3.1. and it crashes because it is missing Swift library. If you set ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES to Yes on Unity-iPhone your app will run just fine on any device.

    On older Unity versions (2017) ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES was set to Yes and tehere were no problems, this change in 2019.3.0 where they introduced UnityFramework just made one big mess, don't forget https://forum.unity.com/threads/uni...tchdog-transgression-crash-0x8badf00d.878620/
     
    yingkai and Polyfemos like this.
  31. Terazilla

    Terazilla

    Joined:
    Apr 27, 2013
    Posts:
    20
    Last edited: Sep 4, 2021
    xLeo and petey like this.
  32. EL-soNK

    EL-soNK

    Joined:
    Jul 13, 2015
    Posts:
    28
    Thanks a million! That worked! Don't know how, but it did -- can cloud build and it gets submitted to Appstore Connect correctly again!
     
  33. playthepad

    playthepad

    Joined:
    May 29, 2020
    Posts:
    1
    What is the exact method name that you put in `Post-Export Method Name` in the Cloud Build config for iOS?

    I'm getting the following error:
    ```
    export method 'Editor.XcodeSwiftVersionPostProcess.OnPostProcessBuild' not found, aborting. Please make sure you are using the correct function signature.
    ```
     

    Attached Files:

  34. EL-soNK

    EL-soNK

    Joined:
    Jul 13, 2015
    Posts:
    28
    I did not configure it at all in Cloud config/Advanced options, it's just in my project's "Editor" folder and named "XcodeSwiftVersionPostProcess.cs".

    This is unrelated to this issue, but seeing your screenshot: you can configure a post build .bash script to push the build directly to AppStore connect.
     
  35. TheDahaka

    TheDahaka

    Joined:
    Nov 11, 2016
    Posts:
    9
    So crazy this is still not fixed two years later... Thanks everyone for the workarounds.
     
  36. Ersin

    Ersin

    Joined:
    Oct 25, 2012
    Posts:
    13
    Thank you , script is solved my problem.
    Unity 2020.3.18f1 , Xcode :13.0
     
    p0w1nd likes this.
  37. mr-secret

    mr-secret

    Joined:
    Nov 25, 2021
    Posts:
    1
  38. Melnikovv

    Melnikovv

    Joined:
    Oct 21, 2016
    Posts:
    8
    It very simple to fix. For some reason Unity switches "Always Embed Swift Standard Libraries".
    No need to run any scripts or delete anything.
    1. Set yes on Always Embed Swift Standard Libraries in target Unity-iPhone in Build Settings.
    2. Set no on Always Embed Swift Standard Libraries in target UnityFramework in Build Settings.
    3. Done
    upload_2021-11-30_21-8-27.png
    upload_2021-11-30_21-10-37.png
     
  39. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,759
    can you submit this bug please?
     
  40. PandaArcade

    PandaArcade

    Joined:
    Jan 2, 2017
    Posts:
    132
    @PavelLU Why hasn't Unity fixed this issue? Why isn't this a priority?

    I'd love to make a game without wasting so much time finding solutions to issues that shouldn't exist. Imagine how much better our games would be! :D

    When Unity's core functionality fails and goes unfixed for so long it makes Unreal 5 look so inviting! o_O
     
    Starbox and studiomercenary like this.
  41. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,759
    Oh, you haven't seen anything. I'm stuck in 2021.1.27 because after that version they introduced bugs that make most shaders look bad. Then in 2021.2 they introduced a bug that doesn't allow you to compile projects in Android Arm32. And in 2022.1 beta I can't even migrate projects.

    All these are reported for months, even during alpha. And they went through beta and full release and still no fixes. Wonderful QA. The list of "known issues" will be larger than the release fixes notes soon. In fact they are for many releases. Awesome.
     
    Last edited: Dec 14, 2021
    Starbox and PandaArcade like this.
  42. astanid

    astanid

    Joined:
    Apr 5, 2021
    Posts:
    146
    Trying to build and upload my game from cloud to appstore. ipa builds fine but if i try to upload it with altool i got that old error with
    I tried this solutions first
    https://forum.unity.com/threads/201...contains-disallowed-file.751112/#post-6959378
    got a bunch of errors error: Invalid SWIFT_VERSION
    I've added this script too
    https://forum.unity.com/threads/201...contains-disallowed-file.751112/#post-7466480
    But i keep getting error
    Code (CSharp):
    1. 18524: ▸ error: Invalid SWIFT_VERSION: Could not parse version component from: '1 5' (in target 'SwiftyXMLParser' from project 'Pods')
    Any idea what to do next ?
     
  43. xLeo

    xLeo

    Joined:
    Sep 21, 2010
    Posts:
    197
    I used the attached script and it solved my issues and successfully uploaded to TestFlight/AppStore.

    I created it based on the solutions proposed in this post and this post.

    It should also fix the issues mentioned by @astanid in this previous post.

    It's also worth to mention that I set "Cocoapods Integration" on ExternalDependencyManager plugin to "Xcode Workspace", which might have influenced the solution to the problem or even fixed it. Either way, now that it's working I won't verify if that really makes any difference. :D
     

    Attached Files:

    peblop, aidis_unity08 and MavenDev like this.
  44. p0w1nd

    p0w1nd

    Joined:
    Oct 28, 2015
    Posts:
    143
    This works for me. Thanks so much!
    I do something like this in my post process script:
    Code (CSharp):
    1.         private static void UpdateBuildSettings(string projectPath)
    2.         {
    3.             #if UNITY_IOS
    4.                 util.log.Info(CLASS_TAG + "--> UpdateBuildSettings");
    5.                 PBXProject project = new PBXProject();
    6.                 project.ReadFromFile(projectPath);
    7.                 string mainTargetId = project.GetUnityMainTargetGuid();
    8.                 project.AddBuildProperty(mainTargetId, "OTHER_LDFLAGS", "-ObjC");
    9.                 project.SetBuildProperty(mainTargetId, "CLANG_ENABLE_MODULES", "YES");
    10.                 project.SetBuildProperty(mainTargetId, "GCC_ENABLE_OBJC_EXCEPTIONS", "YES");
    11.                 project.SetBuildProperty(mainTargetId, "ENABLE_BITCODE", "NO");
    12.                 project.SetBuildProperty(mainTargetId, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "YES");
    13.                 string frameworkId = project.GetUnityFrameworkTargetGuid();
    14.                 project.SetBuildProperty(frameworkId, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "NO");
    15.                 File.WriteAllText(projectPath, project.WriteToString());
    16.             #endif
    17.         }
     
    Last edited: Feb 28, 2022
    Thien-Le, ROBYER1 and Wula like this.
  45. IvyKun

    IvyKun

    Joined:
    Sep 28, 2013
    Posts:
    132
    This fixed it for me. Thanks!
     
    abbasjafari likes this.
  46. FVS

    FVS

    Joined:
    Aug 10, 2015
    Posts:
    58
    It worked for me months ago, now with Unity 2022.2.19, I saw the build was set like that by default, but the same issue appear when I upload the archive. Have any idea?
     
    nnoom1986 and shalika_mendis like this.
  47. DadNapper

    DadNapper

    Joined:
    Jan 13, 2018
    Posts:
    10
  48. Maryia_Ondra

    Maryia_Ondra

    Joined:
    Aug 26, 2020
    Posts:
    7
    Thank you a lot, @Melnikovv! This fixed it for me!!!
     
  49. tobias_unity

    tobias_unity

    Joined:
    Feb 3, 2018
    Posts:
    66
    @Melnikovv does your script only set the correct values in xCode for "Always embed switch standard libraries" or is anything else happening? Because I get complier errors when adding the script to Editor folder (screenshot).

    I get so annoyed when we pay for Unity but still have to fix these errors ourselves...
     

    Attached Files:

  50. tobias_unity

    tobias_unity

    Joined:
    Feb 3, 2018
    Posts:
    66
    I finally managed to get succes on my build. My solution was that I needed to do update some plug-ins that used an older "unity-iPhone" string (it was Native Alerts, Native Share and Agora). After that I set build target to iOS 12.0 (was 11.0) and then it finally managed to build and get accepted in App Store Connect.

    I also set "Always embed switch standard libraries" to NO.