Unity ads 4.4.1 has xcode error "contains disallowed file 'Frameworks'"

When I try to build with the 4.4.1 Advertisement package (from Unity Editor), I get this error when submitting an archive to Apple:

contains disallowed file ‘Frameworks’

If I recompile my project with ads 4.3.0, I can submit to Apple without error.

Hi
I think the problem is with Always Embed Swift Standard Libraries setting for the xcode project. It should be No for UnityFramework and Yes for Unity-iPhone. Could you add a postbuild script to change it and test?

After googling, stackoverflowing, try&error I might have found (at least) a workaround for this.

  • Target Unity-iPhone, set Always Embed Swift Standard Libraries to yes
  • Target Unity-iPhone Tests, set Always Embed Swift Standard Libraries to no
  • Target UnityFramework, set Always Embed Swift Standard Libraries to no

Then what I also did I have deleted the references for com.unity.ads in the Xcode project tree (Unity-iPhone/Frameworks/com.unity.ads).

Upload to TestFlight was successful and also I could see the ads showing in the game. Hope that setup passes the production release as well. :smile:

1 Like

the only solution I’ve found is to use 4.3 for ios.

there is a bug in 4.3 for android banners, I need to build android with 4.4

Starting in SDK version 4.4.0, Unity Ads has been optimized by using the Swift programming language. See Installing the Unity Ads SDK for details. You can use PBXProject class to modify it for example in OnPostprocessBuild.

Yasuyuki, thanks for the hint. After building the xcode project with unity I have followed the hint from unity ads documentation:

If your project does not use Swift, add an empty Swift file to your project in Xcode by selecting File > New > Swift file.

I’ve added the empty swift file and enabled the bridge (as unity builds xcode project in objective-c). As a result submission was fine, without any errors.

2 Likes

This worked for me:

tests should be set to “yes”

finally this is the change I made and everything worked. It’s a unity editor version problem according to some comments. Some versions of Unity set these values correctly.

1 Like

This is the correct answer

1 Like

Actually, I have one more update to this. After updating Xcode to 14.3 there are no errors anymore. (I am wondering why I didn’t think about that earlier :sweat_smile: )

1 Like

Updating XCode does not solve it for me… (Unity 2021.3)