我在OS X 10.11.6上使用Xcode 8.2.1为iOS 10.2构建iPad应用程序,当我尝试调用使用由Carthage构建的特定依赖项的代码时,应用程序崩溃并且似乎表明框架二进制文件没有按预期存储在内存中:
dyld: lazy symbol binding failed: Symbol not found: __TFC12ObjectMapper6MapperCfT7contextGSqPS_10MapContext___GS0_x_
Referenced from: /Users/me/Library/Developer/CoreSimulator/Devices/<UUID>/data/Containers/Bundle/Application/<UUID>/AppName.app/Frameworks/AlamofireObjectMapper.framework/AlamofireObjectMapper
Expected in: /Users/me/Library/Developer/CoreSimulator/Devices/<UUID>/data/Containers/Bundle/Application/<UUID>/AppName.app/Frameworks/ObjectMapper.framework/ObjectMapper
dyld: Symbol not found: __TFC12ObjectMapper6MapperCfT7contextGSqPS_10MapContext___GS0_x_
Referenced from: /Users/me/Library/Developer/CoreSimulator/Devices/<UUID>/data/Containers/Bundle/Application/<UUID>/AppName.app/Frameworks/AlamofireObjectMapper.framework/AlamofireObjectMapper
Expected in: /Users/me/Library/Developer/CoreSimulator/Devices/<UUID>/data/Containers/Bundle/Application/<UUID>/AppName.app/Frameworks/ObjectMapper.framework/ObjectMapper
我使用Alamofire进行HTTPS调用,AlamofireObjectMapper(以及扩展名为ObjectMapper)来解析响应JSON。它在此应用程序/项目的许多先前运行中运行良好,并且似乎自发地开始崩溃。
Alamofire调用做来发出请求并接收响应有什么奇怪的,但是在解析响应时(其格式或数据没有改变)会发生崩溃。所以,显然,包括迦太基构建的框架正在为某些依赖项工作,而不是其他依赖项。我在==
中指定了Cartfile
,并使用Cartfile.resolved
来确定所有依赖项的确切版本。
carthage update --platform iOS
)ObjectMapper.framework
已包含在目标 Link Binary With Libraries 构建阶段以及其他Carthage构建的框架中:
$(SRCROOT)/Carthage/Build/iOS/ObjectMapper.framework
包含在运行/usr/local/bin/carthage copy-frameworks
的运行脚本构建阶段的输入文件中,以及其他几乎相同(且正在工作)的框架路径:
<DerivedData>/AppName.app/Frameworks/ObjectMapper.framework/ObjectMapper
除此之外,为什么这个框架显然是在构建,包含但未加载。如何更深入地调试此问题?
答案 0 :(得分:2)
我遇到了同样的问题。在AlamofireObjectMappter Github上查看此问题。
https://github.com/tristanhimmelman/AlamofireObjectMapper/issues/179
AlamofireObjectMapper可能不支持ObjectMapper最新版本...修复版本2.2.1上的carthage github "Hearst-DD/ObjectMapper" "2.2.1"