Search Unity

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.
     
    Dazo1985 likes this.
  2. MultivariousDev01

    MultivariousDev01

    Joined:
    May 22, 2014
    Posts:
    26
    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!
     
    grimjim, andycampbell92 and Dazo1985 like this.
  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:
    3
    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:
    10
    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:
    10
    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:
    81
    Thank you tried your solution before the edit and got rejected. Trying again after edit.
     
  12. AliBuck

    AliBuck

    Joined:
    Aug 22, 2020
    Posts:
    10
    Any updates?
    Have you been rejected by Apple after their review? Or the build has been rejected by Xcode during validation?
     
  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:
    31
    this also worked for me, thanks for sharing :)
     
    AliBuck likes this.
  15. xLeo

    xLeo

    Joined:
    Sep 21, 2010
    Posts:
    128
    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.
     
  16. boorch

    boorch

    Joined:
    Oct 7, 2015
    Posts:
    35
    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:
    39
    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,528
    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.  
     
    xjjon, fdsagizi2, ersah and 1 other person like this.
  21. AliBuck

    AliBuck

    Joined:
    Aug 22, 2020
    Posts:
    10
    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:
    130
    @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:
    1
    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:

    Shakabuy likes this.
  25. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    238
    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,576
    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,576
    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:
    280
    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
     
  29. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,576
    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:
    280
    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,576
    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:
    280
    Oh then ill have to keep an eye on it.
    Thanks!!
     
unityunity