sparrowcode / PermissionsKit

Universal API for request permission and get its statuses.
https://x.com/sparrowcode_ios
MIT License
5.64k stars 462 forks source link

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

Closed Oggerschummer closed 3 years ago

Oggerschummer commented 3 years ago

Describe the bug After upgrading to Xcode 13 B3 I see the error in the build: 'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead. This was not the case in earlier versions of Xcode (e.g. 13B1). To Reproduce Steps to reproduce the behavior: Added SPPermissions as SwiftPackage, start build

Expected behavior Should build without issue.

Smartphone (please complete the following information):

Additional context Its an app without any extensions thus I do not get why this is thrown. I´m stuck.

Oggerschummer commented 3 years ago

Tried with a different project / workspace. Same result, does not build anymore.

ivanvorobei commented 3 years ago

Yes, have problem in beta. Searching solution

Oggerschummer commented 3 years ago

Did cross-check with B2, here the build works. So maybe they broke something in B3,

ivanvorobei commented 3 years ago

Xcode disable using shared for class UIApplication, that reason. I think I need do some changes in code and remove all using shared. Main idea have controller for present. I will check it and return with new version. I let you know here today-tomorrow.

Oggerschummer commented 3 years ago

Linking Swift packages from application extension targets or watchOS applications no longer emits unresolvable warnings about linking to libraries not safe for use in application extensions. This means that code referencing APIs annotated as unavailable for use in app extensions must now themselves be annotated as unavailable for use in application extensions, in order to allow that code to be used in both apps and app extensions. (66928265)

How about marking your function explicitly unavailable for application extensions using @available(iOSApplicationExtension,unavailable)

ivanvorobei commented 3 years ago

Did it, thanks! New version is 6.6.0 should work fine with Xcode 13.3. Issue closed. Let me know if you have any problem.

Oggerschummer commented 3 years ago

Works perfectly fine, compile error is gone.Thanks!Am 22.07.2021 21:51 schrieb Ivan Vorobei @.***>: Did it, thanks! New version is 6.6.0 should work fine with Xcode 13.3. Issue closed. Let me know if you have any problem.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.