nytimes / NYTPhotoViewer

A modern photo viewing experience for iOS.
http://open.blogs.nytimes.com/2015/03/27/a-new-view-for-nytimes-photos/
Other
2.86k stars 378 forks source link

Unable to run on iOS 12 in 5.0.8 #363

Open Igor-Palaguta opened 1 year ago

Igor-Palaguta commented 1 year ago

We add NYTPhotoViewer using Cocopods and in 5.0.8 appeared an issue during application launch

dyld: Library not loaded: /System/Library/Frameworks/LinkPresentation.framework/LinkPresentation
  Referenced from: XXXX/Frameworks/NYTPhotoViewer.framework/NYTPhotoViewer
  Reason: image not found
philipborbon commented 1 year ago

Hi Igor, Did you managed to get this resolved?

Igor-Palaguta commented 1 year ago

Hi @philipborbon , I remember some API from LinkPresentation (not available in iOS 12) was used in 5.0.8, I switched to previous version. Probably weak linking of LinkPresentation should fix the issue

philipborbon commented 1 year ago

Thanks for the info.

I got it working as suggested also in this thread "Xcode 13 does not weak link LinkPresentation framework?".

"Manually adding LinkPresentation.framework to Link Binary with Libraries build phase, and setting its status to Optional."

Adding it in Pods > NYTPhotoViewer.framework target did the trick.

StainlessStlRat commented 1 year ago

Is the project not being maintained anymore?

Igor-Palaguta commented 3 weeks ago

@philipborbon or we can add to Podfile:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "NYTPhotoViewer"
      target.build_configurations.each do |config|
        config.build_settings['OTHER_LDFLAGS'] ||= ['-weak_framework', 'LinkPresentation']
        config.build_settings['OTHER_LDFLAGS'] << '$(inherited)'
      end
    end
  end
end
Igor-Palaguta commented 2 weeks ago

PR with fix https://github.com/nytimes/NYTPhotoViewer/pull/372