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

问题描述

尝试将 one signal 集成到我的 React Native 应用中。

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

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

Xcode 打开一个标题dyld__abort_with_payload 的话题。

这是它的图像。

enter image description here

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

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 -> 在 Targets 中选择您的应用 -> 转到常规选项卡 -> 框架、库和嵌入式内容

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

enter image description here

奇怪的部分来了。

在添加 OneSignal.xcframework 之后。只需选择并点击 - 即可删除此 OneSignal.xcframework

现在只需重新构建您的应用。您的应用现在应该可以运行了。