hp iOS Coder
hp iOS Coder

Reputation: 3234

still dyld: Library not loaded

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

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 and my iPad runs iOS 5.1 The app runs fine on the simulator (both 6.0 & 5.1), but when I connect the iPad and change the deployment target to 5.1 (as without this the device is not shown to run), the app crashes.

Upvotes: 9

Views: 15064

Answers (4)

Alvin George
Alvin George

Reputation: 14296

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!

Upvotes: 1

kunalg
kunalg

Reputation: 1580

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

Upvotes: 0

hp iOS Coder
hp iOS Coder

Reputation: 3234

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

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

There, set the status of added frameworks to Optional

This solved my problem.

Upvotes: 60

Venk
Venk

Reputation: 5955

You need to add this Framework to Xcode.

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

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.

Perhaps also see this answer: Missing AVFoundation.framework

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

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

Upvotes: 0

Related Questions