我在共享扩展中使用以下 pod。编译器一直显示错误:sharedApplication' 不可用:在 iOS 上不可用(应用程序扩展) - 在适当的情况下使用基于视图控制器的解决方案。在 [UIApplication sharedApplication] 行的每个库中
我在共享扩展目标中安装了所有库。
我的项目中有四个目标,包括 Share-Extension,并且我为每个目标设置了“AppExtension flag is NO”。仍然出现错误。
目标 -> 构建设置 -> 仅需要 AppExtension-Safe API -> 否
我的播客文件:
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'
pod 'ReverseExtension'
end
target ‘Production' do
shared_pods
end
target ‘Development’ do
shared_pods
end
target ‘Testing’ do
shared_pods
end