简体   繁体   中英

iOS Validate archive failed with CFBundleIdentifier Collision & Invalid Bundle

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"
在此处输入图片说明 This is MyAppEmbedded "Linked Frameworks and Libraries"
在此处输入图片说明 This is MyAppShare "Linked Frameworks and Libraries"
在此处输入图片说明 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.
在此处输入图片说明

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.

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.

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 ✅

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM