Cant publish app with a xcframework that contains pods

955 views Asked by At

Context

I developed a framework that contains the following pods: CryptoSwift, SwiftyRSA and PromiseKit. I distribute it as a xcframework in cocoapods. This is how I generated the xcframework:

xcodebuild archive -workspace MySDK.xcworkspace -scheme MySDK -destination="iOS" -archivePath ./ios.xcarchive -derivedDataPath /tmp/iphoneos -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
    
xcodebuild archive -workspace MySDK.xcworkspace -scheme MySDK -destination="iOS Simulator" -archivePath ./iossimulator.xcarchive -derivedDataPath /tmp/iphoneos -sdk iphonesimulator SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
xcodebuild -create-xcframework -framework ./ios.xcarchive/Products/Library/Frameworks/MySDK.framework -framework ./iossimulator.xcarchive/Products/Library/Frameworks/MySDK.framework -output ./MySDK.xcframework

Problem

When I validate the app before for distribution in App Store Connect it fails showing the following error messages:

App Store Connect Operation Error Invalid Bundle Structure - The binary file 'MySDKTest.app/Frameworks/MySDK.framework/Frameworks/Pods_MySDK.framework/Pods_MySDK' is not permitted. Your app can’t contain standalone executables or libraries, other than a valid CFBundleExecutable of supported bundles. Refer to the Bundle Programming Guide at https://developer.apple.com/go/?id=bundle-structure for information on the iOS app bundle structure.

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

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

1

There are 1 answers

0
Francisco Guerrero Escamilla On

In build setting of your framework change Always Embed Swift Standard Libaries -> No