3

Well my app works fine on all the simulators im using on Xcode6 and the Iphone 6+

When trying to run my app on an Ipad with iOS 7.1 its crashes with this error:

dyld: Library not loaded: /System/Library/Frameworks/Photos.framework/Photos
  Referenced from: /Users/Twizzeler/Library/Developer/CoreSimulator/Devices/88F53E5F-C46C-4D1B-8DF5-B858E339E841/data/Applications/5F703CF6-5172-4F6B-A4DC-ADAF99ED55E9/NoName.app/NoName
  Reason: image not found

I googled it and found the following answer: iOS app with framework crashed on device, dyld: Library not loaded, Xcode 6 Beta

This didn't work! what is the problem?

Community
  • 1
  • 1
Twizzler
  • 491
  • 1
  • 7
  • 25

1 Answers1

6

Photos.framework has been added in iOS 8, therefore is not available on iOS 7.1.

You need to "weak link" that framework to avoid the crash.

Also, on iOS 7 and lower, you should be using the ALAssetsLibrary framework instead, which has a different API.

Matteo Pacini
  • 21,796
  • 7
  • 67
  • 74
  • I don't get that last part. How do i weak link ALAssetsLibrary and make a difference between them? – Twizzler Jan 15 '15 at 15:08
  • 1
    You don't weak link `ALAssetsLibrary`; it's a class, not a framework. You weak link `Photos.framework` in your framework list by unchecking the "required" box. – Ian MacDonald Jan 15 '15 at 15:10
  • 1
    @Twizzler You need to weak link `Photos.framework`, not `ALAssetsLibrary`! Xcode -> Targets -> YourTargetName -> Build Phases -> Link Binary With Libraries -> Set Photos.framework to Optional. – Matteo Pacini Jan 15 '15 at 15:10
  • Does that also mean if you need to use a feature in the Photos Framework, like accessing the "My photos Stream", you have to have two implementations, one for 7.x and one for 8.x? – ToddK Apr 13 '15 at 18:15