XCode 无法使用 Firebase Cloud Messaging 编译 Cordova 应用程序

时间:2021-04-28 22:51:38

标签: xcode firebase cordova

项目在集成 FCM 之前有稳定版本。出于某种原因,在我将 Firebase 版本从 6.13.0 更改为 7.11.0 并出现以下错误后,构建失败:

  • “FIRRemoteConfig”没有可见的@interface 声明了选择器“activateWithCompletionHandler:”

  • 在“FIRMessaging *”类型的对象上找不到属性“shouldEstablishDirectChannel”

此外,编译有一些更典型的错误(screenshot 1screenshot 2)与 FIRMessaging。我认为是库或其安装方式有问题。

为解决问题而执行的步骤:

  • 重建 Cocoapods(删除 pods 和 podfile,然后执行 pod install && pod repo update

  • 清理项目/重新打开 XCode/重启 Mac/重建项目核心(Cordova 应用程序)

  • 在项目中更改库的数量及其导入

  • 正在更改 iOS 部署目标版本(检查 11、12 和 13 没有结果)

依赖项与 Cocoapods 一起安装:

# DO NOT MODIFY -- auto-generated by Apache Cordova
source 'https://cdn.cocoapods.org/'
platform :ios, '13.0'
use_frameworks!
target 'AppName' do
 project 'AppName.xcodeproj'
 pod 'Firebase/Core', '7.11.0'
 pod 'Firebase/Auth', '7.11.0'
 pod 'Firebase/Messaging', '7.11.0'
 pod 'Firebase/Performance', '7.11.0'
 pod 'Firebase/RemoteConfig', '7.11.0'
 pod 'Firebase/InAppMessaging', '7.11.0'
 pod 'Firebase/Firestore', '7.11.0'
 pod 'FirebaseCrashlytics', '7.11.0'
 pod 'Fabric', '1.10.2'
 pod 'Crashlytics', '3.14.0'
 pod 'GoogleSignIn', '5.0.2'
 pod 'GoogleTagManager', '7.2.0'
end
post_install do |installer|
 installer.pods_project.targets.each do |target|
  target.build_configurations.each do |config|
   config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
  end
 end
end

0 个答案:

没有答案
相关问题