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
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug An empty folder named 'Frameworks' in UnityFramework.framework

Discussion in '2019.3 Beta' started by kingying, Sep 27, 2019.

  1. kingying

    kingying

    Joined:
    Sep 16, 2019
    Posts:
    2
    Unity 2019.3.0b3 to build an iOS framework => UnityFramework.framework

    There is an empty folder in UnityFramework.framework named "Frameworks", and it shows message
    ERROR ITMS-90206: "Invalid Bundle. The bundle at 'YOUR.app/Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks'."

    After remove the empty folder, it passed the AppStore checking.
     
    ageana, joaquinrosado and Dazo1985 like this.
  2. MultivariousDev01

    MultivariousDev01

    Joined:
    May 22, 2014
    Posts:
    28
    Can confirm this is still happening on Unity 2019.3.0f5 (2019.3.0 Release Candidate 5)

    It appears to be a specific issue with CocoaPods (Our project uses GoogleVR for Unity, which requires Pods to compile to iOS.)

    It is painful to be unable to use Cloud Build for distribution builds at the moment, and we don't quite have the bandwidth at the moment to cook up a build postprocess script to resolve this automatically (especially if Unity is just going to fix it soon).

    Right now, it appears that the workaround that works for us follows this StackOverflow answer: https://stackoverflow.com/a/38161415

    We go into the UnityFramework target of the main project in XCode, and delete the Build Phase called [CP] Embed Pods Frameworks.

    Even if the solution is simply to update CocoaPods, Unity would have to do so as well on their Cloud Build machines because their IPAs are running into this issue at the upload phase...

    Hope this post helps!
     
  3. Dazo1985

    Dazo1985

    Joined:
    Mar 13, 2019
    Posts:
    26
    We got the same issue

    @MultivariousDev01

    Which of the soltutions in your link did you use for the Unity Cloud build?

    We have no macs so manually manipulating the xcode files is not really an option.

    We use a third party sdk which does manipulate the xcode file like


    project.AddBuildProperty(targetGUID, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "YES");

    But the solution in the link mentioned something about "ON extension lvl "NO"

    How exactly is this solution done for Unity?
     
  4. Dazo1985

    Dazo1985

    Joined:
    Mar 13, 2019
    Posts:
    26
    ok this solution worked for us


    project.AddBuildProperty(targetGUID, "EMBED_SWIFT_STANDARD_LIBRARIES", "NO");
    project.AddBuildProperty(mainGameGUID, "EMBED_SWIFT_STANDARD_LIBRARIES", "YES");
     
    unity_Iu70XvRN7XIS4g and xLeo like this.
  5. jenniferplanellas

    jenniferplanellas

    Joined:
    Mar 29, 2015
    Posts:
    7
    Seeing this in 2020.1. @Dazo1985 What is the targetGUID value in this example?
     
  6. iPickle

    iPickle

    Joined:
    Oct 21, 2013
    Posts:
    46
    Could you add the context to what targetGUID, and mainGameGUID are?
    I'm confused with the xcode file structure
     
  7. conscienceawake

    conscienceawake

    Joined:
    Jun 24, 2018
    Posts:
    2
    Legend! this worked for me, thanks a lot :)
     
  8. AliBuck

    AliBuck

    Joined:
    Aug 22, 2020
    Posts:
    30
    Workaround.
    Right-click on the archive in organizer -> Show in Finder
    Right-click on the .xcodearchive file -> Show package contents. Go to folder Products/Applications/
    Right-click on the <YourAppName>.app file -> Show package contents. Go to the folder Frameworks/UnityFramework.framework/
    Delete folder named Frameworks. (The one inside UnityFramework.framework folder! See my screenshot)

    After this the Validation is successful. Apple approved my game just now, so I guess it's safe =)

    EDIT:
    Before archiving the build you have to set "Always Embed Swift Standart Libraries" to YES for the Unity-iPhone target
    Screenshot 2020-09-29 at 13.15.27.png
    Screenshot 2020-09-16 at 23.48.12.png
     
    Last edited: Sep 29, 2020
  9. ocnenued

    ocnenued

    Joined:
    Apr 4, 2018
    Posts:
    26
    This didn't work for us. We had to downgrade Facebook SDK to v7.19.2 and then Apple accepted the binary (unity version 2020.1.6f1).
     
  10. AliBuck

    AliBuck

    Joined:
    Aug 22, 2020
    Posts:
    30
    I've updated my post. Turned out you had to set "Always Embed Swift Standart Libraries" to YES for the Unity-iPhone target
     
  11. gamezuv

    gamezuv

    Joined:
    Nov 6, 2013
    Posts:
    82
    Thank you tried your solution before the edit and got rejected. Trying again after edit.
     
  12. AliBuck

    AliBuck

    Joined:
    Aug 22, 2020
    Posts:
    30
    Any updates?
    Have you been rejected by Apple after their review? Or the build has been rejected by Xcode during validation?
     
    bettywhite likes this.
  13. AlenBrk

    AlenBrk

    Joined:
    Feb 17, 2014
    Posts:
    33
    I had the issue now with the version 2020.1.10f1 , and it helped me! many thanks.
     
    AliBuck likes this.
  14. asger60

    asger60

    Joined:
    Mar 27, 2013
    Posts:
    45
    this also worked for me, thanks for sharing :)
     
    AliBuck likes this.
  15. xLeo

    xLeo

    Joined:
    Sep 21, 2010
    Posts:
    193
    Ok, just updated our project to Unity 2020.1.17f1 from 2019.4.17f1 and we are now facing these error as well.
    We get the following error on Unity Cloud Build, when trying to upload to the App Store:

    Code (none):
    1. 1112: 2021-01-20 15:40:53.158 altool[18362:67827]  Error:
    2. 1113: [2021-01-20 15:40:52 UTC] <main> DBG-X:   parameter ErrorCode = 1102
    3. 1114: [2021-01-20 15:40:52 UTC] <main> DBG-X:   parameter ErrorMessage = ERROR ITMS-90206: "Invalid Bundle. The bundle at 'gouda.app/Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks'.
    4. 1115: [2021-01-20 15:40:52 UTC] <main> ERROR: ERROR ITMS-90206: "Invalid Bundle. The bundle at 'gouda.app/Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks'."
    5. 1116: [2021-01-20 15:40:52 UTC] <main> DBG-X: The error code is: 1102
    6. 1117:         ERROR ITMS-90206: "Invalid Bundle. The bundle at 'gouda.app/Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks'."
    7. 1118:     "Error Domain=ITunesTransporterErrorDomain Code=-18000 \"ERROR ITMS-90206: \"Invalid Bundle. The bundle at 'gouda.app/Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks'.\"\" UserInfo={NSLocalizedRecoverySuggestion=ERROR ITMS-90206: \"Invalid Bundle. The bundle at 'gouda.app/Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks'.\", NSLocalizedDescription=ERROR ITMS-90206: \"Invalid Bundle. The bundle at 'gouda.app/Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks'.\", NSLocalizedFailureReason=ERROR ITMS-90206: \"Invalid Bundle. The bundle at 'gouda.app/Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks'.\"}"
    I have found @Dazo1985 's reply below, but I'm not sure what mainGameGUID stands for.

    Any help will be much appreciated.
     
    carldevelopsforcoffee likes this.
  16. boorch

    boorch

    Joined:
    Oct 7, 2015
    Posts:
    40
    After 2 days, this saved me. I would buy you a beer if I could. Thank you very very very much!
     
    AliBuck likes this.
  17. caglarenes

    caglarenes

    Joined:
    Jul 9, 2015
    Posts:
    45
    Yeah it's saved me too. Thanks a lot.

    Unity 2020.2.2f and Xcode 12.4 have same problem and this workaround solved problem.

    Xcode 12.3 was just worked fine. I don't know what was changed.
     
  18. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,817
    Hi all!
    I tried the workaround and uploaded okay but got rejected :( - Invalid Swift Support
    Not sure what I stuffed up there but I had success with a fresh build by turning the swift embed option to "No" and leaving the folder as is.

    Screen Shot 2021-03-13 at 10.23.41 am.png

    Everything seems to be working okay ¯\_(ツ)_/¯
    (I'm on Unity 202.3 LTS by the way with Xcode 12.4)
     
    AllanRW likes this.
  19. ChrisEtches

    ChrisEtches

    Joined:
    Jul 26, 2016
    Posts:
    3
    @petey your solution worked! I owe you many beers.
     
    petey likes this.
  20. 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.  
     
  21. AliBuck

    AliBuck

    Joined:
    Aug 22, 2020
    Posts:
    30
    Thanks, @petey! Can confirm! It's fixed in Unity 2020.3.1f1 LTS
    Actually with the swift embed option set to "Yes" also validates! (Haven't tried to upload in the store though)
     
    petey likes this.
  22. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    @AliBuck
    So this issue is fixed? If we set Yes to mainTarget we don't need to delete the Frameworks folder from the archive?

    If you don't set Yes to mainTarget app will crash at the start on some devices. Just tested it on Simulator, iPad Pro 9.7-inch, 10.3.1.
     
  23. obbe

    obbe

    Joined:
    Apr 10, 2015
    Posts:
    7
    I got this issue in 2021.1.0f1 when adding some Swift code for the first time.
    AliBucks' solution got past the upload stage but failed during processing as there were *.dylib files that were required and not duplicated anywhere else.

    Instead of deleting the *.dylib files (that aren't duplicated) you can copy them to the Frameworks folder two directories up. Once the lower Frameworks folder is empty you can delete it.

    This got passed the upload and through the processing for me.

    Thanks, AliBuck.
     
  24. ijeanpierrebp

    ijeanpierrebp

    Joined:
    Dec 3, 2017
    Posts:
    2
    Woo bro, THANK YOU VERY MUCH, it worked perfectly, you don't know how I thank you!!!
     

    Attached Files:

    AliBuck and Shakabuy like this.
  25. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    322
    I still always have to remove the Frameworks Folder and set "Always Embed Swift Libraries" manually every time.

    Is there some definite fix for this? I always forgot these steps after some time and it's a headache to generate new builds.
     
  26. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Just wanted to report that I'm getting this problem after building in 2020.3.12. Using Xcode 12.5.

    Binary upload succeeded after changing Swift setting to No on UnityFramework target. Let's see if it gets thrown back once processed by Apple.

    It went though ok. App update now released.

    Just tried another update using same settings - failed to upload to Apple. So I deleted the Frameworks folder in UnityFramework.framework and now it has uploaded.

    Have just had a failure uploading another binary. So I only deleted the Frameworks folder and left the Swift settings as Yes. That worked ok!

    And, just did another build of another app and the Swift setting is the default No, and the Frameworks folder does not exist in UnityFramework.framework. I can't work out why the differences between projects. And this one has uploaded to Apple without issue first time which makes sense.
     
    Last edited: Jul 13, 2021
  27. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Does anyone know why the Frameworks folder is being added to MyApp.app/Frameworks/UnityFramework.framework?

    Looking at an archive I made a couple of months ago (using 2019.4) the folder does not exist. What changed? Is it a 2020.3 thing?
     
  28. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    My AppStore error says:
    ERROR ITMS-90206 Invalid bundle at 'Myapp.app/Frameworks/Unity Framework.framework' contains disallowed file 'Frameworks.

    Also my folders don't have the files I've seen some of you have:


    However, I was able to fix this error by setting
    "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES" = "NO"
    on the Unity Framework target. I didn't need to delete nothing.

    I hope it helps someone.
    Please can someone confirm this is the right approach?

    I'm using Unity 2020.3.12
     
    AminAghajoon, ttesla and florinel2102 like this.
  29. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    You are looking in the wrong place. It's not the build folder - it's within the archive.

    The path is something like this:

    /Users/USERNAME/Library/Developer/Xcode/Archives/2021-07-20/Unity-iPhone 20-07-2021, 16.37.xcarchive/Products/Applications/APPNAME.app/Frameworks/UnityFramework.framework

    See the post above by @AliBuck for instructions of how to find it via Organiser.

    If you see my post above you'll see that changing the Swift setting did work for me on one occasion but on other occasions I had to delete the Frameworks folder in order to upload successfully.
     
    Last edited: Jul 22, 2021
  30. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    Finally found it:

    Doesn't seem like I have the mentioned folder anyway. I guess the Swift setting it's enough for me then.
    Thanks a lot.
     
  31. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Yeah, I don't have that folder in all projects. I haven't worked out why yet.
     
  32. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    Oh then ill have to keep an eye on it.
    Thanks!!
     
  33. hm_assets

    hm_assets

    Joined:
    Sep 30, 2016
    Posts:
    6

    Thanx!
    Worked like a sharm
    Unity 2020.3.19
    Xcode 13.0
     
  34. Lenvanthis012

    Lenvanthis012

    Joined:
    Aug 24, 2013
    Posts:
    21
    Your solution has worked for me. Thank you so much.
     
  35. khushalkhan

    khushalkhan

    Joined:
    Aug 6, 2016
    Posts:
    177
    Can't believe unity still have not fixed this issue
     
  36. GameLover90

    GameLover90

    Joined:
    Jan 5, 2021
    Posts:
    5

    FINALLY ! THIS SOLUTION DID WORK ! THANK YOU SO SO MUCH :D
     
  37. GrizzlyFalcon

    GrizzlyFalcon

    Joined:
    Feb 14, 2015
    Posts:
    10
    How does one go about removing the frameworks folder in a post-build script?
     
  38. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    I have a menu command to delete from the most recent archive.

    My process is like this:
    Get path to Archives folder.
    Get directories at path and sort descending.
    Get directories in first directory and sort descending.
    Append "/Products/Applications" to first directory( xcarchive).
    Get first directory there (app).
    Append "/Frameworks/UnityFramework.framework/Frameworks".
    Delete
     
  39. GrizzlyFalcon

    GrizzlyFalcon

    Joined:
    Feb 14, 2015
    Posts:
    10
    Thank you so much, this is a great point in the right direction! :)

    Could you provide the code that achieves this? I'm not entirely sure how to get to /Frameworks/UnityFramework.framework/Frameworks
     
    Last edited: Aug 9, 2022
  40. RSH1

    RSH1

    Joined:
    Jul 9, 2012
    Posts:
    255
    Just had this with 2021.3.8f1
     
  41. zudesai

    zudesai

    Joined:
    Sep 26, 2022
    Posts:
    4
    Had this with 2021.3.14f1.
    Trying with making "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES" = "NO" for unityFramework.
     
  42. noambe

    noambe

    Joined:
    Aug 13, 2014
    Posts:
    32
    The workaround by AliBuck to delete the Frameworks folder solved the issue for me.

    Anyone knows why this is happening so that Unity can solve the root cause problem? Doing this every time is quite cumbersome.
    In my case the only change I did between the build that repro'ed it vs. a build that doesn't repro it was to upgrade the FB SDK from V11 -> V14
     
  43. Gatsensoft

    Gatsensoft

    Joined:
    Mar 6, 2017
    Posts:
    1
    I had the same problem with Unity Cloud Build using 2020.3.42f1 and this right here was the solution! Thank you very much sir!
     
  44. AliBuck

    AliBuck

    Joined:
    Aug 22, 2020
    Posts:
    30
  45. bettywhite

    bettywhite

    Joined:
    Oct 22, 2019
    Posts:
    14
  46. certeccm

    certeccm

    Joined:
    Mar 16, 2020
    Posts:
    4
    Thank you so much for this thread. I had added a "home made" obj c framework to my unity project and had this exact issue, except for my framework (unity was fine). Deleting the framework folder in the archive did the trick.