XCode添加自定义framework运行时出现dyld: Library not loaded的解决方法
在使用自定义的framework运行时,会出现如下的错误:
dyld: Library not loaded: @rpath/IpuMap.framework/IpuMap
Referenced from: /Users/tony/Library/Developer/CoreSimulator/Devices/A3DD36BB-FA25-4E11-8942-0D981BBCC4BF/data/Containers/Bundle/Application/6DE5B52D-7993-4720-BFD3-73262FB02740/DisplayClient.app/DisplayClient
Reason: image not found
根据提示我们了解到是因为Library没有加载到,网上说将Link Binary With Libraries中的Required改为Optional就可以,但这只能运行,根本上还是没有将Library没有加载进来。
所以根据提示是要将自定义的framework打包到ipa中,
在项目的General->Embedded Binaries中,将我们自定的framework 添加进去,如下图: