dyld:库未加载:@rpath/OneSignal.framework/OneSignal

dyld: Library not loaded: @rpath/OneSignal.framework/OneSignal

正在尝试将 one signal 集成到我的 React 本机应用程序中。

我遵循了文档中提到的所有说明 https://documentation.onesignal.com/docs/react-native-sdk-setup.

应用程序构建成功,但在将应用程序附加到设备时出现错误。

Xcode 打开标题为 dyld__abort_with_payload 的话题。

这是它的图片。

当我查看错误时。错误看起来像这样。

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

我已经好几个小时没试过了。任何帮助将不胜感激。

提前致谢。 :)

我得到的解决方案真的很奇怪,它只是在尝试时出现并且能够为我解决这个问题。所以如果这里有人遇到同样的错误可以试试这个。

步骤

打开 Xcode -> Select 你的应用在 Targets -> 转到常规选项卡 -> 框架、库和嵌入内容

点击 +。在其中搜索 OneSignal 并添加 OneSignal.xcframework.

奇怪的部分来了。

添加OneSignal.xcframework后。只需选择并单击 -.

即可删除此 OneSignal.xcframework

现在重新构建您的应用程序。您的应用现在应该 运行。