react-native-onesignal icon indicating copy to clipboard operation
react-native-onesignal copied to clipboard

dyld[7510]: Library not loaded: @rpath/OneSignalInAppMessages.framework/OneSignalInAppMessages Error on App Launch when running in Real Device. Simulator it's working fine

Open pankajnegi1893 opened this issue 2 years ago • 3 comments

What happened?

I am using latest version of the SDK. But getting below issue in iPhone Device. but working fine in iOS Simulator:

dyld[7510]: Library not loaded: @rpath/OneSignalInAppMessages.framework/OneSignalInAppMessages
  Referenced from: <2C346952-C25D-3A51-BF35-3870ED1EC2BF> /private/var/containers/Bundle/Application/C084B74F-1DE6-4A73-8F3F-256B9A68B85A/Heyo Development.app/Heyo Development

  Reason: tried: '/usr/lib/swift/OneSignalInAppMessages.framework/OneSignalInAppMessages' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalInAppMessages.framework/OneSignalInAppMessages' (no such file), 
'/private/var/containers/Bundle/Application/C084B74F-1DE6-4A73-8F3F-256B9A68B85A/Heyo Development.app/Frameworks/OneSignalInAppMessages.framework/OneSignalInAppMessages' (no such file), 

'/private/var/containers/Bundle/Application/C084B74F-1DE6-4A73-8F3F-256B9A68B85A/Heyo Development.app/Frameworks/OneSignalInAppMessages.framework/OneSignalInAppMessages' (no such file), 

'/usr/lib/swift/OneSignalInAppMessages.framework/OneSignalInAppMessages' (no such file, not in dyld cache), 

'/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalInAppMessages.framework/OneSignalInAppMessages' (no such file), 

'/private/var/containers/Bundle/Application/C084B74F-1DE6-4A73-8F3F-256B9A68B85A/Heyo Development.app/Frameworks/OneSignalInAppMessages.framework/OneSignalInAppMessages' (no such file), 

'/private/var/containers/Bundle/Application/C084B74F-1DE6-4A73-8F3F-256B9A68B85A/Heyo Development.app/Frameworks/OneSignalInAppMessages.framework/OneSignalInAppMessages' (no such file)

package.json

"react-native-onesignal": "^5.0.2",

Xcode Version : 15.0

Framework,Libraries and Embedded Content : Screenshot 2023-10-27 at 19 00 40

Podfile

target 'MyApp' do

  config = use_native_modules!
   ........
  target 'OneSignalNotificationServiceExtension' do
    pod 'OneSignalXCFramework', '>= 5.0.0', '< 6.0'
  end
   ............
end

Steps to reproduce?

1. Install latest version 5.0.2
2. Do pod install
3. Launch the app on iOS device

What did you expect to happen?

App should launch correctly like this working in iOS Simulator.

React Native OneSignal SDK version

5.0.2

Which platform(s) are affected?

  • [X] iOS
  • [ ] Android

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

pankajnegi1893 avatar Oct 27 '23 13:10 pankajnegi1893

Hi @pankajnegi1893 thank you for your patience. Is this still an issue for you? If so, are you able to update to the latest release and let us know if the behavior is the same?

Thanks!

jennantilla avatar Nov 23 '23 01:11 jennantilla

To fix above issue I have tried below steps

  1. Removed OneSignalNotificationServiceExtension Completed from Xcode project.

  2. cd ios && pod install

  3. Now follow React Native SDK Setup

  4. Because we are added few script like Setup Firebase Environment GoogleService-Info.plist and [CP-User] [RNFB] Crashlytics Configuration. Beacause of these script are running first after that it checking OneSignalInAppMessages.xcframework. So we have to move "Embed Foundation extension" before "Compile sources".

73efff22-c103-4edb-953e-831fe7a8c33d
  1. Some other key points

Add OneSignalInAppMessages.xcframework into Frameworks,Libraries and Embedded Content

f8de7028-eb22-4138-9d59-d938e7b24fc8
  1. In Pod file include this in bottom
 target 'OneSignalNotificationServiceExtension' do
    pod 'OneSignalXCFramework', '>= 5.0.0', '< 6.0'
  end

pankajnegi1893 avatar Nov 23 '23 04:11 pankajnegi1893

Hello @pankajnegi1893 apologies for the delay in getting back to you. I'm unsure from your previous response if this is still an issue for you or if those steps resolved your problem? Thanks for the udpate!

jennantilla avatar Feb 03 '24 00:02 jennantilla