小编Pav*_*hav的帖子

'sharedApplication' 不可用:在 iOS(应用扩展)上不可用 - 在适当的情况下使用基于视图控制器的解决方案

我在共享扩展中使用以下 pod。编译器不断显示错误:sharedApplication' 不可用:在 iOS(应用程序扩展)上不可用 - 在适当的情况下使用基于视图控制器的解决方案。在 [UIApplication sharedApplication] 行上的每个库中

  1. 我在 Share Extension 目标中安装了所有库。

  2. 我的项目中有四个目标,包括 Share-Extension,并且我为每个目标设置了“AppExtension flag is NO”。还是出现错误。

Target -> Build Settings -> Require Only AppExtension-Safe API -> NO

我的播客文件:

platform :ios, '11.2'
def shared_pods
use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'

pod 'XMPPFramework', :git => "https://github.com/robbiehanson/XMPPFramework.git", :branch => 'master'

pod 'MBProgressHUD'  

pod 'GoogleMaps'

pod 'GooglePlaces'

pod 'AccountKit'

pod 'Alamofire', '~> 4.5'

pod 'AlamofireImage', '~> 3.3'

pod 'SVProgressHUD'

pod 'SDWebImage', '~> 4.1.1'

pod 'AWSS3', '~> 2.6.0'

pod 'Fabric'

pod 'Crashlytics'

pod 'Firebase/Core'

pod 'Firebase/Messaging' …
Run Code Online (Sandbox Code Playgroud)

xcode ios cocoapods swift share-extension

3
推荐指数
3
解决办法
7548
查看次数

标签 统计

cocoapods ×1

ios ×1

share-extension ×1

swift ×1

xcode ×1