我该如何解决这个问题?
dyld: Library not loaded: /System/Library/Frameworks/AVFoundation.framework/Versions/A/AVFoundation Referenced from: /Users/[...]/Library/Application Support/iPhone Simulator/User/Applications/[...]/TestGame.app/TestGame Reason: image not found
答案 0 :(得分:4)
您需要将此框架添加到Xcode。
右键点击“框架”>选择添加>现有框架 找到“AVFoundation”,然后选择Add。
如果您想手动添加,请选择其他按钮并导航至:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk/System/Library/Frameworks/AVFoundation.framework/
将iPhone SDK版本替换为您正在构建的任何内容。
也许也会看到这个答案:Missing AVFoundation.framework
此外,有时您只需要关闭Xcode,然后清理并重建。
答案 1 :(得分:4)
我遇到同样的问题,能够通过将添加的框架设置为Optional
而不是Required
来解决它
从此处Project-> Targets-> Build Phases-> Link Binary with Libraries
,将添加(或创建问题)框架的状态更改为Optional
,,它将成功运行。