Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sagarthecoder opened this issue Jun 19, 2022 · 5 comments

Comments

@sagarthecoder
Copy link

sagarthecoder commented Jun 19, 2022

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
Copy link

Sumina01 commented Jul 4, 2023

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

@sagarthecoder
Copy link
Author

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

@Sumina01
Copy link

Sumina01 commented Jul 4, 2023

But solving in one place create same error in other libraries

@sagarthecoder
Copy link
Author

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

@Sumina01
Copy link

Sumina01 commented Jul 4, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants