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

[Bug]: Library not loaded: @rpath/OneSignalCore.framework/OneSignalCore #1459

Closed
2 of 3 tasks
ElChawich opened this issue Dec 1, 2022 · 39 comments
Closed
2 of 3 tasks

Comments

@ElChawich
Copy link

ElChawich commented Dec 1, 2022

What happened?

After updating to version 4.5.0 the app builds successfully. But after the app tries to open, it crashes immediately giving this error:
Screenshot 2022-12-01 at 6 14 30 AM

Also when running npx pod-install i get this in the logs but it proceeds to install successfully:

[!] CocoaPods could not find compatible versions for pod "OneSignalXCFramework":
  In snapshot (Podfile.lock):
    OneSignalXCFramework (< 4.0, = 3.11.2, >= 3.0)

  In Podfile:
    OneSignalXCFramework (< 4.0, >= 3.0)

    react-native-onesignal (from `../node_modules/react-native-onesignal`) was resolved to 4.5.0, which depends on
      OneSignalXCFramework (= 3.12.3)


You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * changed the constraints of dependency `OneSignalXCFramework` inside your development pod `react-native-onesignal`.
   You should run `pod update OneSignalXCFramework` to apply changes you've made.
Couldn't install: OneSignalXCFramework. Updating the Pods project and trying again...

Steps to reproduce?

1. update to 4.5.0 version
2. build the app and try opening it.

What did you expect to happen?

for the app to open and work normally

React Native OneSignal SDK version

4.5.0

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ymc-thzi
Copy link

ymc-thzi commented Dec 1, 2022

Having the same problem. Even when I have done a $ pod repo update afterwards and the pod install succeeded.
XCode crashes with the same error.
My workaround is to set the version fixed to 4.4.1 for now... 🤷🏻‍♂️

Library not loaded: @rpath/OneSignalCore.framework/OneSignalCore

@fhboswell
Copy link
Contributor

Hello, @ElChawich & @ymc-thzi
Please try running
pod update OneSignalXCFramework

If you are still having issues please share the version of OneSignalXCFramework in your PodFile.lock

@ElChawich
Copy link
Author

Hello @fhboswell,
pod update command was automatically ran from the beginning and the OneSignalXCFramework version in Podfile.lock became 3.12.3

@fhboswell
Copy link
Contributor

fhboswell commented Dec 1, 2022

Thank you for the information @ElChawich,
What version of CocoaPods are you using?

@maoryadin
Copy link

Same error!

@ymc-thzi
Copy link

ymc-thzi commented Dec 2, 2022

@ElChawich thanks for answering. So I executed pod update OneSignalXCFramework then it updates the framework from OneSignalXCFramework (3.11.2) to OneSignalXCFramework (3.12.3) taken from the Podfile.lock.
But installing the pods again with this version it still crashes with the same error
Library not loaded: @rpath/OneSignalCore.framework/OneSignalCore

@emawby
Copy link
Contributor

emawby commented Dec 2, 2022

Make sure you are using Cocoapods 1.11.3 and try the below code. We have seen this issue when using versions lower than 1.11.3

rm Podfile.lock
pod cache clean --all
pod install --repo-update

@ElChawich
Copy link
Author

hello @fhboswell and @emawby,
Thank you for your replies.
My cocoapods version is 1.11.3, and i just tried @emawby's solution yet same error is still occuring

@nan-li
Copy link
Contributor

nan-li commented Dec 3, 2022

Hi all,
Please also check your ruby version and update to version 2.7.5 or above, if you have a lower version than this.

@morozbogdn
Copy link

having the same problem. cannot resolve it

@BishalftSaikia
Copy link

in my case i removed "open using Rosetta" and followed the first answer on this stack https://stackoverflow.com/questions/69098207/could-not-find-ffi-1-3-0-among-85-total-gems-gemmissingspecerror-re , this solves ffi issues on my M1, try this , this may help.

@kenkeydev
Copy link

Same issue. Downgrading to 4.4.1 solved my problem.

@cenksari
Copy link

After hours of effort, I reached the following conclusion and successfully ran the application.

If you are using XCode 14 and higher:

Go to Project --> Targets --> [Application Name] --> Frameworks, Libraries, and Embedded Content section.
Click + icon --> Type OneSignal in the search box --> Select OneSignalCore.xcframework and click Add button.
Do the same for OneSignalOutcomes.xcframework.
Check Embed and Sign on both.

Cean build folder and build.

I'm putting a screenshot below.

Screenshot 2022-12-12 at 14 58 32

@Zeeshan404
Copy link

Zeeshan404 commented Dec 12, 2022

@cenksari Thanks it worked for me. I was having this issue when upgraded react-native-onesignal to 4.5.0

@yana-shkvoretz
Copy link

@cenksari This definitely fixed my issue! Thanks a lot!

@Dev-Ahmed-Adnan
Copy link

@cenksari This works perfectly with me, Many thanks.

@janandaraj
Copy link

janandaraj commented Dec 28, 2022

After hours of effort, I reached the following conclusion and successfully ran the application.

If you are using XCode 14 and higher:

Go to Project --> Targets --> [Application Name] --> Frameworks, Libraries, and Embedded Content section. Click + icon --> Type OneSignal in the search box --> Select OneSignalCore.xcframework and click Add button. Do the same for OneSignalOutcomes.xcframework. Check Embed and Sign on both.

Cean build folder and build.

I'm putting a screenshot below.

Screenshot 2022-12-12 at 14 58 32

@cenksari
I had same issue after upgrading from 3.x.x. to 4.5.0, and app crashed on start in ios, so I have added as you mentioned but build failed.

podfile

target 'OneSignalNotificationServiceExtension' do
pod 'OneSignalXCFramework', '>= 3.11.1', '< 4.0'
end

Podfile.lock

  • OneSignalXCFramework (3.12.3):
    • OneSignalXCFramework/OneSignalCore (= 3.12.3)
    • OneSignalXCFramework/OneSignalExtension (= 3.12.3)
    • OneSignalXCFramework/OneSignalOutcomes (= 3.12.3)
    • OneSignalXCFramework/OneSignalCore (3.12.3)
    • OneSignalXCFramework/OneSignalExtension (3.12.3):
      • OneSignalXCFramework/OneSignalCore
      • OneSignalXCFramework/OneSignalOutcomes
    • OneSignalXCFramework/OneSignalOutcomes (3.12.3):
      • OneSignalXCFramework/OneSignalCore

attaching screenshot here,
Screenshot 2022-12-28 at 2 44 43 PM

Error says this any idea how to fix this/any one experienced this issue ?

Multiple commands produce '/Users/PC/Library/Developer/Xcode/DerivedData/Beach_Runners-byldswpvmwonzqheuuipyzwfvqba/Build/Intermediates.noindex/ArchiveIntermediates/Truckerbux/InstallationBuildProductsLocation/Applications/Beach Runners.app/Frameworks/OneSignalCore.framework':

  1. Target 'Beach Runners' has copy command from '/Users/PC/Documents/Beach Runners/ios/Pods/OneSignalXCFramework/iOS_SDK/OneSignalSDK/OneSignal_Core/OneSignalCore.xcframework/ios-arm64_armv7_armv7s/OneSignalCore.framework' to '/Users/PC/Library/Developer/Xcode/DerivedData/Beach_Runners-byldswpvmwonzqheuuipyzwfvqba/Build/Intermediates.noindex/ArchiveIntermediates/Truckerbux/InstallationBuildProductsLocation/Applications/Beach Runners.app/Frameworks/OneSignalCore.framework'
  2. That command depends on command in Target 'Beach Runners': script phase “[CP] Embed Pods Frameworks”

@muxbert
Copy link

muxbert commented Jan 4, 2023

Hey @janandaraj I am facing same error, have you fixed it?

@janandaraj
Copy link

@muxbert Hi i just removed OneSignalCore and OneSignalOutcomes from frameworks and did exactly in the documentation now it works but still i'm facing some missing push notification on iPhone device(on OneSignal Site it says delivered), android works fine

@jnsmith0274
Copy link

jnsmith0274 commented Jan 6, 2023

After hours of effort, I reached the following conclusion and successfully ran the application.
If you are using XCode 14 and higher:
Go to Project --> Targets --> [Application Name] --> Frameworks, Libraries, and Embedded Content section. Click + icon --> Type OneSignal in the search box --> Select OneSignalCore.xcframework and click Add button. Do the same for OneSignalOutcomes.xcframework. Check Embed and Sign on both.
Cean build folder and build.
I'm putting a screenshot below.

I also have the exact same issue as @janandaraj including the build error that multiple commands produce "..." Disappointing that more recent versions of OneSignal are not playing nice with the iOS/Xcode ecosystem.

@mljlynch
Copy link

mljlynch commented Jan 9, 2023

I just hit this - it would be nice if versions like this would be marked as breaking changes (major version updates) in the future.

@dhameliyawork
Copy link

I am also getting this issue with XCode 14 with "react-native-onesignal": "^4.5.0",

I tried solution mentioned above #1459 (comment) but it doesn't work for me unfortunately.

Multiple commands produce Build/Products/Debug-iphoneos/spectrum.app/Frameworks/OneSignalOutcomes.framework'

@moonvader
Copy link

When I build app using Xcode it crashes after launch - embeding OneSignalCore.framework and OneSignalOutcomes.framework as suggested above fix this problem.
But after this fix app fails to build on CI with Multiple commands produce error.

@yendiscart
Copy link

yendiscart commented Jan 15, 2023

Solved this issue by adding extension as in the screenshot and it works
image

@muktadirsonyy911
Copy link

After hours of effort, I reached the following conclusion and successfully ran the application.

If you are using XCode 14 and higher:

Go to Project --> Targets --> [Application Name] --> Frameworks, Libraries, and Embedded Content section. Click + icon --> Type OneSignal in the search box --> Select OneSignalCore.xcframework and click Add button. Do the same for OneSignalOutcomes.xcframework. Check Embed and Sign on both.

Cean build folder and build.

I'm putting a screenshot below.

Screenshot 2022-12-12 at 14 58 32

Saved my day❤️

@karankharode
Copy link

After hours of effort, I reached the following conclusion and successfully ran the application.

If you are using XCode 14 and higher:

Go to Project --> Targets --> [Application Name] --> Frameworks, Libraries, and Embedded Content section. Click + icon --> Type OneSignal in the search box --> Select OneSignalCore.xcframework and click Add button. Do the same for OneSignalOutcomes.xcframework. Check Embed and Sign on both.

Cean build folder and build.

I'm putting a screenshot below.

Screenshot 2022-12-12 at 14 58 32

If anyone is still facing this issue in Flutter or React Native,
I have given the solution here
"https://stackoverflow.com/a/75446410/13561397"

It is much similar to the above solution but if you have not create the Notification service extension then you should do that first which is explained on above link
That should help you out
Cheers!

@geekz-reno
Copy link

geekz-reno commented Feb 16, 2023

I am also getting this issue with XCode 14 with "react-native-onesignal": "^4.5.0",

I tried solution mentioned above #1459 (comment) but it doesn't work for me unfortunately.

Multiple commands produce Build/Products/Debug-iphoneos/spectrum.app/Frameworks/OneSignalOutcomes.framework'

for anyone facing same problem, try to remove at the Build Phases -> Link Binary With Libraries and left PodsRunner only

@shkvoretz
Copy link

upgrading ruby and cocoapods as well as using onesignal_flutter: 3.4.1 fixed the issue for my Intel Mac

@daoibrahim
Copy link

After hours of effort, I reached the following conclusion and successfully ran the application.

If you are using XCode 14 and higher:

Go to Project --> Targets --> [Application Name] --> Frameworks, Libraries, and Embedded Content section. Click + icon --> Type OneSignal in the search box --> Select OneSignalCore.xcframework and click Add button. Do the same for OneSignalOutcomes.xcframework. Check Embed and Sign on both.

Cean build folder and build.

I'm putting a screenshot below.

Screenshot 2022-12-12 at 14 58 32

Worked like a charme with Flutter as well. Thank you so much

@shkvoretz
Copy link

@daoibrahim what arch are you on? Intel or M1?

@XTalandier
Copy link

After hours of effort, I reached the following conclusion and successfully ran the application.

If you are using XCode 14 and higher:

Go to Project --> Targets --> [Application Name] --> Frameworks, Libraries, and Embedded Content section. Click + icon --> Type OneSignal in the search box --> Select OneSignalCore.xcframework and click Add button. Do the same for OneSignalOutcomes.xcframework. Check Embed and Sign on both.

Cean build folder and build.

I'm putting a screenshot below.

Screenshot 2022-12-12 at 14 58 32

It works perfectly for me. Not all heroes wear capes

@palanikumar32
Copy link

After hours of effort, I reached the following conclusion and successfully ran the application.

If you are using XCode 14 and higher:

Go to Project --> Targets --> [Application Name] --> Frameworks, Libraries, and Embedded Content section. Click + icon --> Type OneSignal in the search box --> Select OneSignalCore.xcframework and click Add button. Do the same for OneSignalOutcomes.xcframework. Check Embed and Sign on both.

Cean build folder and build.

I'm putting a screenshot below.

Screenshot 2022-12-12 at 14 58 32

It's working

@levarberry
Copy link

As of today this isn't part of the install documentation, However, it worked for me. Spent hours on this.

@doyeka
Copy link

doyeka commented Mar 28, 2023

Still facing this issue using "react-native-onesignal": "4.5.1".

All of the suggestions in this thread didn't work for me. My environment:
Xcode 14.2
macOS Ventura 13.2.1
2.3 GHz Quad-Core Intel Core i7
node 19.2.0

Downgrading to "react-native-onesignal": "4.4.1" solved the issue for me. Please fix this in your future releases. Happy to send more information if needed.

@tronglv92
Copy link

Solved this issue by adding extension as in the screenshot and it works image

you save my day

@Remas-Safi
Copy link

upgrading ruby and cocoapods as well as using onesignal_flutter: 3.4.1 fixed the issue for my Intel Mac

This helped fixing my problem, where I faced two problems when I added the OneSignalOutcomes.xcframework to the Frameworks, Libraries, and Embedded Content section, I got the Multiple commands produce ...etc error, where it worked correctly before. And if I remove them the app crashes once built and starts running .... updating cocoapods fixes this

@adefokun
Copy link

adefokun commented Jul 6, 2023

Under Targets, click your app name. Include OneSignalExtension.xcframework in Framework, Library and Embedded Content.

@wahyu-handayani
Copy link

Solved this issue by adding extension as in the screenshot and it works image

Thank you so much, I search the solution for a day and finally find it after doing your step

@jennantilla
Copy link
Contributor

Hello everyone! The discussion in this thread with solutions has been great--thank you to all who contributed! As it appears that these solutions have addressed the problem for many folks here, I'll go ahead and close this issue. If anyone is still facing this on at least React Native 4.5.2 or 5.0.5 please @ mention me with an updated summary of what you're seeing and we'll be happy to put fresh eyes on it.

Thanks!

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

No branches or pull requests