Can't submit my app to App Store or Run in an emulator

The Problem

Using SquareInAppPaymentsSDK and SquareBuyerVerificationSDK in my React Native/Expo app:

  1. App Store rejects submission - “Invalid Bundle. Contains disallowed nested bundles”

  2. Simulator crashes on launch - Missing CorePaymentCard.framework

Both work fine on Android. This used to work on iOS but broke after recent updates.

App Store Error

Invalid Bundle. The bundle at 'SquareInAppPaymentsSDK.framework' 
contains disallowed file 'Frameworks'.

Invalid Bundle. Contains disallowed nested bundles.

Invalid Signature. The file at "SquareInAppPaymentsSDK.framework/setup" 
is not properly signed.

Same errors for SquareBuyerVerificationSDK.framework.

Simulator Crash

Library not loaded: @rpath/CorePaymentCard.framework/CorePaymentCard
Referenced from: SquareBuyerVerificationSDK.framework

Already tried: cleaning pods, reinstalling dependencies, updating Node

Any help appreciated!

:waving_hand: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Build on iOS
Update Reader SDK Version
Build on iOS: In-App Payments SDK

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

The issues you’re experiencing with the SquareInAppPaymentsSDK and SquareBuyerVerificationSDK in your React Native/Expo app are related to iOS-specific packaging and framework dependencies.

App Store Rejection

The App Store rejection is due to the presence of nested bundles within the SquareInAppPaymentsSDK.framework and SquareBuyerVerificationSDK.framework. Apple disallows nested bundles in app submissions. To resolve this, you should:

  1. Check Framework Structure: Ensure that the frameworks do not contain any nested bundles or unnecessary files. You might need to repackage the frameworks if they contain disallowed structures.

  2. Proper Signing: Ensure that all frameworks are properly signed. This includes checking your build settings in Xcode to ensure that the code signing identity and provisioning profiles are correctly configured.

Simulator Crash

The simulator crash due to the missing CorePaymentCard.framework suggests that there is a missing dependency or incorrect linking in your project. To address this:

  1. Verify Framework Dependencies: Ensure that all required frameworks, including CorePaymentCard.framework, are included in your Xcode project. You might need to manually add this framework if it’s not automatically included.

  2. Check Build Phases: In Xcode, go to the “Build Phases” tab of your project and ensure that all necessary frameworks are listed under “Link Binary with Libraries.”

  3. Framework Search Paths: Ensure that the framework search paths in your Xcode project settings are correctly set to include the directories where these frameworks are located.

  4. Reinstall Pods: If you’re using CocoaPods, try running pod install again to ensure all dependencies are correctly installed.

If these steps do not resolve the issues, you may need to reach out to Square’s support or check for any updates or patches that address these specific problems with the SDKs.

This answer was reviewed by @Bryan-Square.