Error “'sharedApplication' is unavailable: not available on iOS (App Extension)…” when compiling after pod update

后端 未结 4 644
自闭症患者
自闭症患者 2020-12-18 21:32

Hi have a projets(including app extension) using cocoapods. (with Parse, Bolts, etc library).

All work fine before (using bolts 1.1.5 library), but, when i\'ve run a

相关标签:
4条回答
  • 2020-12-18 21:54

    Just refer to this, which will help you out:

    https://github.com/AFNetworking/AFNetworking/issues/2119

    0 讨论(0)
  • 2020-12-18 21:56

    Cocoapods are very useful (I'm sure), however they are designed to work with Apps, not App Extensions, and ultimately you lose control of the features they introduce during an update, so you will need to be more judicial about what versions of libraries you do use, based on the APIs they utilize.

    In the case of Bolts 1.2.0, it's obviously decided to use sharedApplication, thus making it unsuitable for use in an App Extension.

    So you will need to start using the libraries in source form, perhaps using git submodule for each one, that will allow you to update them when upstream is updated.

    0 讨论(0)
  • 2020-12-18 21:56

    I've fixed this by downgrading cocoapods to 0.35.2

    If you have a more clean solution, i'm open!

    0 讨论(0)
  • 2020-12-18 22:06

    That is a problem related to the settings of Cocoapods projects

    You can probably find the answer here

    UIApplication.sharedApplication not available

    0 讨论(0)
提交回复
热议问题