Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Store Connect Operation Error when using SPM integration #317

Closed
mbuchetics opened this issue Apr 7, 2021 · 4 comments
Closed

App Store Connect Operation Error when using SPM integration #317

mbuchetics opened this issue Apr 7, 2021 · 4 comments
Labels
spm Swift Package Manager

Comments

@mbuchetics
Copy link

Integration Details (please complete the following information):

  • SDK/Library Version: 9.0.0-beta1
  • Environment: Sandbox
  • iOS Version: unrelated
  • Device: unrelated
  • Integration type & version: Xcode 12.4 with SPM

Describe the bug
I integrated v9.0.0-beta1 of the Drop In SDK using SPM (previously using Carthage). Building & running the app works fine. However, when trying to upload a build to App Store Connect, it fails with the following errors:

App Store Connect Operation Error
Invalid directory. The bundle Payload/Fahrgast.app/PlugIns/CardinalMobile.framework is not contained in a correctly named directory. It should be under "Frameworks".

App Store Connect Operation Error
Invalid directory. The bundle Payload/Fahrgast.app/PlugIns/PPRiskMagnes.framework is not contained in a correctly named directory. It should be under "Frameworks".

App Store Connect Operation Error
CFBundleIdentifier Collision. There is more than one bundle with the CFBundleIdentifier value 'com.cardinalcommerce.CardinalMobile' under the iOS application 'Fahrgast.app'.

App Store Connect Operation Error
CFBundleIdentifier Collision. There is more than one bundle with the CFBundleIdentifier value 'com.paypal.PPRiskMagnes' under the iOS application 'Fahrgast.app'.

When looking into the produced .app I can see that CardinalMobile.framework and PPRiskMagnes.framework both exist twice: in the Frameworks folder AND in the PlugIns folder.
This only happens if the app that is being archived contains extensions, in my case an Intent and IntentUI app extension .

To Reproduce
Steps to reproduce the behavior:

  1. Open the SPMTest project
  2. Change the SPM dependency to use version 9.0.0-beta1 (I haven't tested with the master branch)
  3. Add an Intent extension (which also adds an IntentUI extension)
  4. Archive the project
  5. Inspect the produced .app

Expected behavior
No .framework files copied into the PlugIns folder. App Store Connect upload to run without errors.

Screenshots
Screenshot 2021-04-07 at 16 12 40
Screenshot 2021-04-07 at 16 38 06

@mbuchetics
Copy link
Author

This seems to be a SPM issue related to binary frameworks in general: https://forums.swift.org/t/swift-package-binary-framework-issue/41922
There is a workaround described in the posting that I am going to try later.

@sestevens sestevens added the spm Swift Package Manager label Apr 7, 2021
@mbuchetics
Copy link
Author

I can confirm that the workaround as described in the Swift Forums fixes the issue. This is the script I am using as the last "Run Script" in the build phase of the main app:

#!/bin/bash

COUNTER=0
while [ $COUNTER -lt "${SCRIPT_INPUT_FILE_COUNT}" ]; do
    tmp="SCRIPT_INPUT_FILE_$COUNTER"
    FILE=${!tmp}

    echo "Removing $FILE"
    rm -rf "$FILE"
    let COUNTER=COUNTER+1
done

Input Files:
$(BUILT_PRODUCTS_DIR)/$(PLUGINS_FOLDER_PATH)/CardinalMobile.framework
$(BUILT_PRODUCTS_DIR)/$(PLUGINS_FOLDER_PATH)/PPRiskMagnes.framework

@sestevens
Copy link
Contributor

@mbuchetics Thank you for posting this!

@sestevens
Copy link
Contributor

We added a note about this issue and the workaround in the SPM section of the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spm Swift Package Manager
Projects
None yet
Development

No branches or pull requests

2 participants