繁体   English   中英

如何在 swift 框架内使用 cocoapods

[英]How to use cocoapods inside swift framework

我正在开发一个框架,我在我的框架中添加了带有 cocoapods 的 alamofire,但是当我将我的框架添加到我的目标应用程序时,它会因以下错误而崩溃:

dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire
  Referenced from: /Users/apple/Library/Developer/CoreSimulator/Devices/A9426EAA-64AA-4A24-A50E-24CA9781ED02/data/Containers/Bundle/Application/D068D428-93BA-4224-A673-4456C8A67B41/hovitaSignSdkTest.app/Frameworks/cryptography.framework/cryptography
  Reason: image not found
dyld: launch, loading dependent libraries
DYLD_SHARED_CACHE_DIR=/Users/apple/Library/Developer/CoreSimulator/Caches/dyld/20C69/com.apple.CoreSimulator.SimRuntime.iOS-14-4.18D46
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/apple/Library/Developer/Xcode/DerivedData/hovitaSignSdkTest-fktcpojeagezfbacyzycszboqcfd/Build/Products/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:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/Cor

我确实将Embed&Sign添加到我的框架的目标应用程序中。

我通过将$(BUILT_PRODUCTS_DIR)/AlamofireBuild Settings>Runpath Search Paths来解决此问题

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM