When I am try to submit my app to app store, I am getting the error:
ERROR ITMS-90685: "CFBundleIdentifier Collision. There is more than one bundle with the CFBundleIdentifier value com.companyname.projectName under the application ProjectName.app"
Can any one help me?
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,
H
embeds framework F1
and framework F2
F1
embeds framework F2
F2
will be duplicated in bundle after IPA generatedOnly HostApp but no other frameworks should embed any dependent frameworks in their respective Build Phase. So,
F1
F2
from Embed Frameworks
step, or remove full stepF1
Do Not Embed
option for F2
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.
Steps without script:
This seems to be a long standing bug that is even present with Swift Package Manager. For the build phase of the extensions, I added this "Run Script" as the last step:
cd "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/"
if [[ -d "Frameworks" ]]; then
rm -fr Frameworks
fi
This removes the duplicate framework it's complaining about during archiving, which will be linked from the host target anyway. We just need it to be linked in Xcode for the extension so we can compile at development time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With