‘sharedApplication’ is unavailable: not available on iOS (App Extension)

‘sharedApplication’ is unavailable: not available on iOS (App Extension)

This error may occur when we try to build some third-party pods which are using [UIApplication sharedApplication]

According to Apple 

Some APIs Are Unavailable to App Extensions

Because of its focused role in the system, an app extension is ineligible to participate in certain activities. An app extension cannot:

  • Access a sharedApplication object, and so cannot use any of the methods on that object

To temporarily get rid of this you can Set Require Only App-Extension-Safe API to “NO”. in build settings for that target and compile .

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top