square / in-app-payments-ios

Public repository that hosts the Square In-App Payments SDK iOS binaries
15 stars 6 forks source link

Failed to distribute to Appstore with Xcode 15.x #57

Closed darkengine closed 7 months ago

darkengine commented 9 months ago

Failed to update binary using Xcode 15.x to App Store for review. Meet these errors:

1, Asset validation failed Invalid Signature. Code object is not signed at all. The file at path MyApp.app/Frameworks/SquareInAppPaymentsSDK.framework/setup” is not properly signed. Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level). Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a Simulator target. If you are certain your code signing settings are correct, choose “Clean All” in Xcode, delete the “build” directory in the Finder, and rebuild your release target. For more information, please consult https://developer.apple.com/support/code-signing.

2, Asset validation failed Invalid Bundle. The bundle at 'MyApp.app/Frameworks/SquareInAppPaymentsSDK.framework' contains disallowed nested bundles.

3, Asset validation failed Invalid Bundle. The bundle at 'MyApp.app/Frameworks/SquareInAppPaymentsSDK.framework' contains disallowed file 'Frameworks'.


Works fine with Xcode 14.x

kuldip-simform commented 9 months ago

I am having the same issue. Any luck, @darkengine? I am using Expo, and I have created a plugin to add this to my Xcode project. I have checked by prebuild ios command that it is getting added at the right place with the right value.

richardpiazza commented 8 months ago

I'm running into this issue as well. Any hints or work-arounds?

dotswift commented 7 months ago

As an XC15 user who just started the process of integrating this SDK, I am concerned about this issue.

What has been the workaround so far? Any tips? Any ETA on a fix 🙏

Is this relevant...? (excerpt below)

Important Note: The build phase script requires you to reset your Swift Package Caches when switching from a debug build to a release build (archiving) or vice versa. 
This helps prevent errors during building or releasing. You can reset your cache by using File -> Packages -> Reset Package Caches in Xcode.
richardpiazza commented 7 months ago

@dotswift I haven't found a workaround yet, but I think it has something to do with the setup script being included in the XCFramework.

 [Application Loader Error Output]: ERROR: [ContentDelivery.Uploader] Asset validation failed (90035) Invalid Signature. Code object is not signed at all. The file at path “Nice.app/Frameworks/SquareInAppPaymentsSDK.framework/setup” is not properly signed.

I haven't had a chance to try and remove that file and see if the upload succeeds.

As far as the build phase script you mentioned… let's just say integrating with this SDK via swift package manager has been a real drag on productivity. Having to constantly (not every time) rebuild the dependency tree to switch between simulator/device/previews is beyond frustrating. I refuse to use anything other than SPM, so it's something I have to deal with.

observableobject commented 7 months ago

We need the framework to be upgraded to support Xcode 15 Stat!!

richardpiazza commented 7 months ago

Fixed in https://github.com/square/in-app-payments-ios/releases/tag/1.6.3 (maybe ?)

~Although, I'm still running into asset validation failures using Xcode 15.2/15.3~

brandonjenniges commented 7 months ago

This should be fixed in 1.6.3. You'll also need to update the build phase run script to now be:

SETUP_SCRIPT=${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}"/SquareInAppPaymentsSDK.framework/setup"
if [ -f "$SETUP_SCRIPT" ]; then
  "$SETUP_SCRIPT"
fi

There also shouldn't be anymore issue of needing to reset the package cache in between debug and release builds.

brandonjenniges commented 7 months ago

@richardpiazza Are you still getting those asset validation failures even after updating the build phase run script?

richardpiazza commented 7 months ago

@brandonjenniges Looks like reseting the script did the trick. Was able to successfully upload a build using GitHub's macOS 14 runner with Xcode 15.2.

Thanks!