xcode 仍然 dyld:库未加载

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12915050/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:50:13  来源:igfitidea点击:

still dyld: Library not loaded

iphoneobjective-cxcodeios-simulatorios6

提问by hp iOS Coder

I am integrating Facebook in my application. As required frameworks I added to the project. But the app crashes without loading even first screen.

我正在将 Facebook 集成到我的应用程序中。作为必需的框架,我添加到项目中。但是该应用程序甚至没有加载第一个屏幕就崩溃了。

dyld: Library not loaded: /System/Library/Frameworks/AdSupport.framework/AdSupport
  Referenced from: /var/mobile/Applications/8E09C9AA-CA81-4C26-AEED-B2C632B60A54/Gridlocked.app/Gridlocked
  Reason: image not found

I use xcode 4.5 & my iPad runs iOS 5.1 The app runs fine on simulator (both 6.0 & 5.1) But when I connect iPad & change the deployment target to 5.1(as without this device is not shown to run) app crashes

我使用 xcode 4.5 & 我的 iPad 运行 iOS 5.1 该应用程序在模拟器上运行良好(6.0 和 5.1)但是当我连接 iPad 并将部署目标更改为 5.1(因为没有此设备未显示运行)应用程序崩溃

Can anyone pls help to get out of it. I really spent good time & still looking struggling to achieve success

任何人都可以帮助摆脱它。我真的度过了美好的时光,仍然在努力争取成功

回答by hp iOS Coder

Found out the solution to the problem. The problem was setting the added frameworks as requiredinstead of optional

找到了解决问题的方法。问题是根据需要设置添加的框架而不是可选的

GO TO Project-> Targets-> Build Phases-> Link Binary with Libraries

转到项目-> 目标-> 构建阶段-> 将二进制文件与库链接

There, set the status of added frameworks to Optional

在那里,将添加的框架的状态设置为Optional

This solved my problem.

这解决了我的问题。

回答by A.G

It may happen because of framework compilation. I worked out it

这可能是由于框架编译而发生的。我解决了

App target -> Build Phases -> Embed Frameworks.

应用程序目标 -> 构建阶段 -> 嵌入框架。

So mark copy only when installing on. Clean the project and run it!

所以只在安装时标记副本。清理项目并运行它!

回答by Venk

You need to add this Framework to Xcode.

您需要将此框架添加到 Xcode。

Right-click on "Frameworks" > Choose Add > Existing Frameworks Locate "AVFoundation" then choose Add.

右键单击“框架”> 选择“添加”>“现有框架”找到“AVFoundation”,然后选择添加。

If you want to add it manually, choose the other button and navigate to:

如果您想手动添加它,请选择另一个按钮并导航到:

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk/System/Library/Frameworks/AVFoundation.framework/

Replace the iPhone SDK version with whatever you are building against.

将 iPhone SDK 版本替换为您正在构建的任何版本。

Perhaps also see this answer: Missing AVFoundation.framework

也许还可以看到这个答案:Missing AVFoundation.framework

Also, sometimes you just need to close Xcode, then clean and rebuild.

此外,有时您只需要关闭 Xcode,然后清理并重建。

also see dyld: Library not loaded: AVFoundation.framework Reason: image not found

另请参阅dyld:未加载库:AVFoundation.framework 原因:找不到图像

回答by kunalg

I had the same problem. i keep all .dylib in system root directory usr/libit working fine. At the run time .o file not get .dylib file path then it gives an error.

我有同样的问题。我将所有 .dylib 保存在系统根目录usr/lib 中,它工作正常。在运行时 .o 文件没有得到 .dylib 文件路径然后它给出一个错误。