ERROR ITMS-90685: "CFBundleIdentifier Collision. There is more than one bundle"
Cause
It happens if your HostApp embeds a framework which has been also embedded in some of the frameworks which are also being embedded in HostApp. For example,
- Host
H
embeds frameworkF1
and frameworkF2
- Framework
F1
embeds frameworkF2
- Thus, Framework
F2
will be duplicated in bundle after IPA generated
Solution
Only HostApp but no other frameworks should embed any dependent frameworks in their respective Build Phase. So,
- Go to Build Phase tab for
F1
- Remove
F2
fromEmbed Frameworks
step, or remove full step - Go to General tab for
F1
- Select Frameworks, Libraries and Embedded Content
- Select
Do Not Embed
option forF2
Have a clean build.
Sometimes this doesn't have anything to do with App Extensions, in an app without any App Extension this can be originated because you're duplicating a framework inside the generated IPA.
In my case the issue was I was importing a framework A that contained other two frameworks B & C, all in the same workspace. In the app I was importing A, B, C but in the framework A the frameworks B & C were embedded with the Embed & sign and that's incorrect and it was causing the issue. It should have been added with the Do not embed.