tilltue / TLPhotoPicker

📷 multiple phassets picker for iOS lib. like a facebook
MIT License
1.88k stars 332 forks source link

'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead. #340

Open sagarthecoder opened 2 years ago

sagarthecoder commented 2 years ago

Got this error ('shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead.) inside TLAssetPreviewViewController class and in this line
updatePreferredContentSize(for: asset, isPortrait: UIApplication.shared.orientation?.isPortrait == true)
When I'm using this pods in any App Extension. Though I solved this by following ways.

  1. go to Pods project
  2. Select TLPhotoPicker
  3. Build Setting
  4. set NO for Require Only App-Extension-Safe-API

But Can you solve this please. Because when I install pod again then everytime I need to solve this error manually.

Sumina01 commented 1 year ago

May I know how did you resolve this issue @sagarthecoder ? I have same issue now

sagarthecoder commented 1 year ago

I've already written. Follow those steps. @Sumina01

Sumina01 commented 1 year ago

But solving in one place create same error in other libraries

sagarthecoder commented 1 year ago

Then I don't know and I'm currently not using this library. We manually created this type of project right now.

Sumina01 commented 1 year ago

I fixed it adding below code in podfile

post_install do |installer|
  react_native_post_install(installer)
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'No'
     end
  end
end