skip to Main Content

Trying to integrate one signal in my react native app.

I followed all the instructions mentioned in the docs
https://documentation.onesignal.com/docs/react-native-sdk-setup.

The build for the app gets succeeded but I get an error while attaching the app to the device.

Xcode opens a thread with a title dyld__abort_with_payload.

Here’s the image of it.
enter image description here

And when I look into the errors. The Errors look like this.

dyld: Library not loaded: @rpath/OneSignal.framework/OneSignal
  Referenced from: /Users/sakshyaarora/Library/Developer/CoreSimulator/Devices/357B8E50-B8A6-4F9D-AE06-40DD8004351E/data/Containers/Bundle/Application/242BEDF6-76CD-4516-BF58-C86C43F6C4D4/Test.app/Test
  Reason: image not found
dyld: launch, loading dependent libraries
DYLD_SHARED_CACHE_DIR=/Users/sakshyaarora/Library/Developer/CoreSimulator/Caches/dyld/20F71/com.apple.CoreSimulator.SimRuntime.iOS-14-5.18E182
DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
DYLD_LIBRARY_PATH=/Users/sakshyaarora/Library/Developer/Xcode/DerivedData/Test-djshtsdmeowdbaebqzmujevyppyj/Build/Products/Debug-iphonesimulator:/Users/sakshyaarora/Sites/projects/Test/Builds/iOS/build/Debug/-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Applica

It’s been hours since I am trying this out. Any help would be appreciated.

Thanks in advance. 🙂

2

Answers


  1. Chosen as BEST ANSWER

    The solution I got is really very weird and it just came out while trying and was able to resolve this issue for me. So if anyone here is getting the same error can try this.

    Steps

    Open Xcode -> Select your app in the Targets -> Go to General Tab -> Frameworks, Libraries and Embedded Content.

    Click on + . Search for OneSignal in it and add OneSignal.xcframework.

    enter image description here

    Here comes the weird part.

    After OneSignal.xcframework is added. Just remove this OneSignal.xcframework by selecting and clicking -.

    Now just build your app again. Your app should run now.


  2. If you are facing the same issue in Flutter or React-Native
    Then you should try to create a OneSignalNotificationServiceExtension in the Targets and add this extension in Frameworks, Libraries and Embedded Content section of Target>General.

    You can follow the following steps:

    1. Open Runner.xcworkspace from the iOS folder of your project
    2. Click on "+" icon to add a Target and search for Notification Service Extension

    enter image description here

    1. Create a new Notification Service Extension for OneSignal, select your team and keep the rest as default.

    2. In the next step go to General Tab > Frameworks,Libraries and Embedded Content and add "OneSignalCore.xcframework", "OneSignalOutcomes.xcframework" by clicking the "+" icon and keep it on the framework list as "Embed & Sign", also add the newly created Notification Service Extension as shown in the below screenshot.

    enter image description here

    1. Next Step is to add and remove(yes that’s right) the "OneSignal.xcframework" (please be careful with the name, this one is just onesignal…), so you have to add OneSignal.xcframework in General Tab > Frameworks,Libraries and Embedded Content by clicking the "+" icon and then remove it by selecting this list item and clicking the "-" icon.

    After doing these steps you can simply clean your project and run it, it should work!!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search