1

我正在尝试在我的应用中安装 Firebase In-App Messaging 组件我之前已经安装了我现有的 firebase 组件,下面是我的 package.json 在安装应用内消息之前对于 firebase 的样子。

    "@react-native-firebase/analytics": "^6.7.1",
    "@react-native-firebase/app": "^6.7.1",
    "@react-native-firebase/crashlytics": "^6.7.1",
    "@react-native-firebase/dynamic-links": "^6.7.1",
    "@react-native-firebase/messaging": "^6.7.1",

所以我决定

npm install --save @react-native-firebase/in-app-messaging@^6.7.1

当我尝试pod install我得到以下错误:

CocoaPods could not find compatible versions for pod "GoogleDataTransportCCTSupport":
  In snapshot (Podfile.lock):
    GoogleDataTransportCCTSupport (= 3.0.0, ~> 3.0)

  In Podfile:
    RNFBInAppMessaging (from `../node_modules/@react-native-firebase/in-app-messaging`) was resolved to 6.7.1, which depends on
      Firebase/InAppMessaging (~> 6.13.0) was resolved to 6.13.0, which depends on
        FirebaseInAppMessaging (~> 0.15.5) was resolved to 0.15.6, which depends on
          GoogleDataTransportCCTSupport (~> 1.0)

    RNFBMessaging (from `../node_modules/@react-native-firebase/messaging`) was resolved to 6.7.1, which depends on
      Firebase/Messaging (~> 6.13.0) was resolved to 6.13.0, which depends on
        FirebaseMessaging (~> 4.1.9) was resolved to 4.1.10, which depends on
          FirebaseCore (~> 6.2) was resolved to 6.4.0, which depends on
            FirebaseCoreDiagnostics (~> 1.0) was resolved to 1.2.4, which depends on
              GoogleDataTransportCCTSupport (~> 3.0)

我在这里错过了什么吗?

4

3 回答 3

1
  1. 更新 cocopod ( https://guides.cocoapods.org/using/getting-started.html )
  2. 删除 pod 锁定文件
  3. pod install
于 2020-06-30T21:05:08.207 回答
1

重复的CocoaPods 找不到 pod“GoogleDataTransportCCTSupport”的兼容版本

发生这种情况是因为您显然使用的是已弃用的 firebase 5.xx。简而言之,您需要采取上述问题中推荐的解决方法。

或者您可以升级到 firebase 6.xx

于 2020-06-30T19:11:30.750 回答
0

看起来您的 podfile 中可能存在冲突。删除您的 podfile 并运行pod install --repo-update可能会有所帮助。还要确保您没有旧版本遗留下来的任何 firebase pod(请参见此处)。

于 2020-06-30T19:29:49.157 回答