iOS Validate archive failed with CFBundleIdentifier Collision & Invalid Bundle
Asked Answered
R

2

5

I archived my app and would like to upload the ipa file.
But, uploading was failed with these errors.

App Store Connect Operation Error
CFBundleIdentifier Collision. There is more than one bundle with the     CFBundleIdentifier value 'org.alamofire.Alamofire' under the iOS application     'MyApp.app'.

App Store Connect Operation Error
CFBundleIdentifier Collision. There is more than one bundle with the     CFBundleIdentifier value 'org.alamofire.AlamofireImage' under the iOS application 'MyApp.app'.

App Store Connect Operation Error
CFBundleIdentifier Collision. There is more than one bundle with the     CFBundleIdentifier value 'com.swiftyjson.SwiftyJSON' under the iOS application 'MyApp.app'.

App Store Connect Operation Error
Invalid Bundle. The bundle at 'MyApp.app/Frameworks/MyAppEmbedded.framework' contains disallowed nested bundles.

App Store Connect Operation Error
Invalid Bundle. The bundle at 'MyApp.app/Frameworks/MyAppEmbedded.framework' contains disallowed file 'Frameworks'.

App Store Connect Operation Error
Invalid Bundle. The bundle at 'MyApp.app/PlugIns/MyAppShare.appex' contains disallowed nested bundles.

App Store Connect Operation Error
Invalid Bundle. The bundle at 'MyApp.app/PlugIns/MyAppShare.appex' contains disallowed file 'Frameworks'.

Project use Swift, but some third party library use Objective-C.
These are my project structure.

Targets
MyApp - Main App
MyAppEmbeddded - Embedded Framework
MyAppShare - Share Extension
MyApp, MyAppEmbedded and MyAppShare use Carthage & CocoaPods.
This is MyApp "Embedded Binaries" and "Linked Frameworks and Libraries"
enter image description here This is MyAppEmbedded "Linked Frameworks and Libraries"
enter image description here This is MyAppShare "Linked Frameworks and Libraries"
enter image description here CFBundleIdentifier Collision Error occurred "Alamofire", "AlamofireImage" and "SwiftyJSON".
These three framework are used by MyAppEmbedded.
So, I think Embedded Framework has something a cause.
Also, I noticed ipa content is strange.
Embedded Framework include three same Embedded Frameworks.
enter image description here

I read some questions about uploading errors and checked Build Settings.
MyApp: "Always Embed Swift Standard Libraries" is YES
MyAppEmedded & MyAppShare: "Always Embed Swift Standard Libraries" is NO

If you know about this error, please tell me about it.

Rosinarosinante answered 21/9, 2018 at 14:10 Comment(0)
R
10

I found out the solution.

I removed the frameworks used by main app from the Embedded Framework and ShareExtension.
And my app can be builded and upload validation is OK.

I thought that Embedded Framework and Extension need including frameworks, but Only main app include frameworks, other targets also be able to use frameworks included by main app.

Rosinarosinante answered 24/9, 2018 at 7:10 Comment(1)
Just ran into the same issue with a NotificationServiceExtension. By removing the lib from the extension, adding it to the main target allowed me to access the lib in the NotificationServiceExtension that was nested in that target & access the lib in the NotificationServiceExtension.Meagher
H
5

I have modules set like this:

First module
Second module (embeds First module)
Main App (embeds First and Second module)

Setting Embed to Do Not Embed for First module in Second module target (NOT Main App!) solved the problem for me ✅

enter image description here

Himalayas answered 30/5, 2020 at 7:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.