编译时出现错误现象:
dyld: Library not loaded: @rpath/DFULibrary.framework/DFULibrary
Referenced from: /private/var/mobile/Containers/Bundle/Application/F33A206D-59CF-4ECE-96F4-3814818A09E3/nRF Toolbox.app/nRF Toolbox
Reason: image not found
最近更新Xcode10.2,我添加的是DFU中的iOSDFULibrary.framework,每次更新Xcode版本,swift语法升级时,都需要利用Carthage升级framework包,然而又出现 Library not loaded: 错误,导致一直运行不了工程。
解决方案:
在工程中的build phases中添加一个脚本,如下图
脚本:/usr/local/bin/carthage copy-frameworks
Input Files:
$(SRCROOT)/Carthage/Build/iOS/ZIPFoundation.framework
$(SRCROOT)/Carthage/Build/iOS/iOSDFULibrary.framework
Output Files:
$(DERIVED_FIL