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

Unable to upload to App Store Connect #10

Open
loganblevins opened this issue Mar 17, 2021 · 31 comments
Open

Unable to upload to App Store Connect #10

loganblevins opened this issue Mar 17, 2021 · 31 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@loganblevins
Copy link

loganblevins commented Mar 17, 2021

Error with Xcode Version 12.4 (12D4e):

The bundle Payload/Covenant Eyes.app/PlugIns/OneSignal.framework is not contained in a correctly named directory. It should be under "Frameworks".".

Issue is resolved by hand, deleting framework from PlugIns.

https://forums.swift.org/t/swift-package-binary-framework-issue/41922

However, OneSignal is the only troublesome SPM package I've encountered - and we use multiple SPM packages.

Is there anything OneSignal can do to resolve this?

@emawby emawby added help wanted Extra attention is needed bug Something isn't working labels Mar 17, 2021
@loganblevins
Copy link
Author

We have had to revert back to the standard framework package to avoid this bug.

This XCFramework is quite literally unusable as-is. Our automated builders are failing to upload to App Store Connect and we cannot rely on developers deleting a duplicate framework within an archive to make the upload succeed.

@blorsch
Copy link

blorsch commented Mar 23, 2021

We are also experiencing this issue. After adding via SPM OneSignal works perfectly and can be archived, but when we go to upload to App Store Connect we receive a whole slew of errors:
Screen Shot 2021-03-21 at 10 58 12 PM
Screen Shot 2021-03-21 at 11 04 26 PM

If I inspect the .app file, it looks like OneSignal.framework and the notification app extension are being placed within the "PlugIns" folder, erroneously according to Xcode. We have other SPM packages and we’ve been able to successfully upload builds for months with them. We are planning to use OneSignal in production, but we can’t until we can upload builds.

Any help would be much appreciated. This is with OneSignal-XCFramework v3.3.0 and Xcode 12.4.

@josala
Copy link

josala commented Apr 3, 2021

I had the same issue and I had to remove the OneSignal Swift package and install it via pod. Make sure to specify the latest version (currently pod 'OneSignal', '3.4.0') because otherwise installs 2.x and has some incompatibilities with the current SDK setup guide.

@zoejessica
Copy link

zoejessica commented May 12, 2021

We are running into exactly the same issue - we were able to resolve (on CI too) by adding a final build phase script that removes the OneSignal framework from the Plugins folder, as per this technique by Kevin Bui. $(BUILT_PRODUCTS_DIR)/$(PLUGINS_FOLDER_PATH)/OneSignal.framework needs to be added as an Input File for the script.

Update: turned out to not be reliable - also reverting back to OneSignal-iOS-SDK for now.

@salami
Copy link

salami commented May 12, 2021

Same problem here. Using OneSignal-XCFramework SPM on an M1 Apple Silicon Mac. Xcode 12.5

I just switched over to OneSignal-iOS-SDK for now, still using SPM. Please address this, thank you.

@acoomans
Copy link

+1 same issue here. Would like to see this solved.

@emawby
Copy link
Contributor

emawby commented May 20, 2021

Thank you for reporting I am looking into this. It seems like other Binary Swift Packages are having similar issues . I was hopeful that Xcode 12.5 would solve the issue, but it seems it hasn't.

To be clear are folks having issues archiving their apps or is there only an issue occurring once the archive has been uploaded to App Store connect? In my testing I am able to successfully archive, but if I have an app extension or app clip that also uses the OneSignal library from the XCFramework Swift Package then validation fails when uploading to app store connect.

@salami
Copy link

salami commented May 20, 2021

The archive is successful. The error occurs at the end of the upload process and it does not get sent to App Store Connect.

@emawby
Copy link
Contributor

emawby commented May 20, 2021

I am able to reproduce this. I get the same errors as when I include the XCFramework directly and embed it both the App and Extension targets. I am not sure why SwiftPM is trying to embed the framework when it doesn't need to. I will look into ways to modify the Package itself to make it not do that, but otherwise we will need a build script or manual deletion of the framework from the plugin to resolve the issue until Apple addresses it. I apologize for the inconvenience.

The manual workaround that works for me is to modify the archive before validating/distributing it.

  1. Right click the Archive
  2. Show in finder
  3. Right click > Show package contents of the .xcarchive
  4. Products > Applications > xx.app > Right click Show package contents
  5. Plugins > OneSignalNotificationServiceExtension.appex > Right click Show package contents
  6. Delete the Frameworks folder.

If you have an app clip or other app extensions that depend on the XCFramework you will need to delete the Frameworks folder from them as well.

@imrealashu
Copy link

@emawby I've been facing the same issue and ended up here and did the steps you've mentioned. It solved two of the errors, thanks for that but, this still has 2 issues. Could you help me point out what are those?
I'm using React Native (>0.60) with OneSignal.
Screenshot 2021-06-13 at 03 35 21

Thanks in advance!

@emawby
Copy link
Contributor

emawby commented Jun 29, 2021

@imrealashu What version of React-Native-OneSignal are you using?

@emawby
Copy link
Contributor

emawby commented Jun 29, 2021

Updating with another workaround. Instead of directly including the OneSignal library in the NotificationServiceExtension target you can update the NSE's Runpath search paths build setting to include the path @executable_path/../../Frameworks. This will make it so that the NSE will look for Frameworks in the main app targets Frameworks directory.
image

@neha275
Copy link

neha275 commented Oct 19, 2021

+1 facing same issue
can anybody resolved this?

@Semty
Copy link

Semty commented Oct 31, 2021

@neha275 confirmed, it's still here
@emawby when will this issue be fixed? Your second 'workaround' just doesn't work, the first one works, but it feels just wrong

@ispiropoulos
Copy link

@Semty the second "work around" was actually set by default on a project I am working. I was facing a different problem but triggered by the same root cause (Xcode was crashing at archive export), and it seems like adding the framework into the notification extension target is redundant, at least with Xcode 13.1 as it automatically configures Runpath Search Paths like @emawby described above.

@cdf1982
Copy link

cdf1982 commented Dec 14, 2021

@emawby's workaround 1 is still useful: with Xcode 13.1 and OneSignalXCFramework 3.9.1 I could archive successfully, but as soon as I started the signing process in an Ad Hoc distribution, Xcode would actually crash!

Removing the folder as recommended fixed the crash and therefore the issue.

Hopefully, an actual solution that not requires spelunking in the package will be available with a future release.

@paskcountry
Copy link

Still same issue, I solved the problem with the workaround 1. Thanks @emawby ! .But not sure if it would not affect the behaviour of OneSignal Notifications. I am not able to deliver the notifications to all users (who has accept the push notifications of course). I am using SPM.

@emawby
Copy link
Contributor

emawby commented Jan 28, 2022

@paskcountry Hello I am sorry to hear about the issue with notification delivery. This issue should not be affecting that so if you are still having issues feel free to open a new issue on the iOS SDK repo.

@paskcountry
Copy link

Thanks for your reply emawby! I have integrated OneSignal in another app. And It's working fine. There's one step to integrate it that I have avoid this time. In the documentation page, to integrate it via Swift Package Manager (I love SPM) . STEP 6 : 6_. Select the OneSignalNotificationServiceExtension (follow the setup guide if you have not created one yet) and under "Frameworks and Libraries" click the + button._ I have not do it this time.

So no need to after archiving it, doing these steps, you told before:

Right click the Archive
Show in finder
Right click > Show package contents of the .xcarchive
Products > Applications > xx.app > Right click Show package contents
Plugins > OneSignalNotificationServiceExtension.appex > Right click Show package contents
Delete the Frameworks folder.

The upload to the app store was successful and Notifications working really WELL.

@emawby
Copy link
Contributor

emawby commented Jan 31, 2022

Great that is good to know I will remove that line from the documentation

@LukaszDziwosz
Copy link

How to attach keys with SMP?

@raphaeldcout
Copy link

Hello,
i'm experiencing this problem. Any permanent solution?

@jarrodparkes
Copy link

I'm still experiencing the same problem (CFBundleCollision) when trying to build with Bitrise CI/CD's most recent, stable stack — Xcode 13.2.x on macOS 11.6 (Big Sur).

@mortenholmgaard
Copy link

mortenholmgaard commented Mar 25, 2022

@emawby Please look into this issue! We have all kinds of problems with this with every release we are trying to make!!

@mortenholmgaard
Copy link

I didn't get this problem the first time I tried in xCode 13.3 - any one else that can verify if this is solved in that version?

@paolosanchi
Copy link

paolosanchi commented Apr 8, 2022

I solved by installing the framework with the CocoaPod (Option 3) instead of using the Swift Package Manager (Option 1).
https://documentation.onesignal.com/docs/ios-sdk-setup#step-3-import-the-onesignal-sdk-into-your-xcode-project

@marister
Copy link

marister commented May 3, 2022

We solved it in our React Native project by telling the library not to embed Swift libraries. Hope it helps someone.
(We use cocopods)

image

@AlexHartford
Copy link

AlexHartford commented Jul 8, 2022

This is still an issue regardless of how the extension or app is configured.

Using https://github.com/OneSignal/OneSignal-iOS-SDK instead works (Make sure to use at least this version and follow the instructions!) - but this issue needs to be addressed as the documentation for SPM is recommending this version of OneSignal.

It appears that the build I linked was actually created to solve this issue, but for some reason, there is no reference to it in this repository or the documentation.

Edit: I spoke too soon. It's not fixed. Had to use Carthage to install.

@UraFIZ
Copy link

UraFIZ commented Jan 28, 2023

What do you mean by saying 'otherwise installs 2.x '?

@phanbaohuy96
Copy link

We solved it in our React Native project by telling the library not to embed Swift libraries. Hope it helps someone. (We use cocopods)

image

This saves my day! Tks you.

@Senninseyi
Copy link

Senninseyi commented Jul 11, 2024

Screenshot 2024-07-11 at 09 06 45

This is the issue i face when i try to push to appstore

when i remove the OneSignalNotificationServiceExtension.appex i get to publish successfully and i have my provisioning provider working fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests