dyld[7510]: Library not loaded: @rpath/OneSignalInAppMessages.framework/OneSignalInAppMessages Error on App Launch when running in Real Device. Simulator it's working fine
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 :
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
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!
To fix above issue I have tried below steps
-
Removed OneSignalNotificationServiceExtension Completed from Xcode project.
-
cd ios && pod install
-
Now follow React Native SDK Setup
-
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".
- Some other key points
Add OneSignalInAppMessages.xcframework into Frameworks,Libraries and Embedded Content
- In Pod file include this in bottom
target 'OneSignalNotificationServiceExtension' do
pod 'OneSignalXCFramework', '>= 5.0.0', '< 6.0'
end
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!