CocoaPods无法找到与“FBSDKCoreKit”兼容的版本。

4
我在使用这个库时遇到了麻烦,我按照 Facebook 的说明在 readMe 中完成了所有步骤。在此之前,我使用了 react-native-fbsdk 库,但由于 Facebook 发布了更新版本(0.9)的 SDK,该库现已被弃用。在此处的说明中提到,您可以将需要的 pod 添加到 ios 的 podfile 中,但是当我添加后运行 pod install 时出现了以下错误:
[!] CocoaPods could not find compatible versions for pod "FBSDKCoreKit":
  In snapshot (Podfile.lock):
    FBSDKCoreKit (= 9.0.1, ~> 9.0.1)

  In Podfile:
    FacebookShare was resolved to 0.1.1, which depends on
      FBSDKCoreKit (~> 4.14)

react-native-fbsdk-next (from `../node_modules/react-native-fbsdk-next`) was resolved to 4.0.0, which depends on
  react-native-fbsdk-next/Core (= 4.0.0) was resolved to 4.0.0, which depends on
    FBSDKCoreKit (~> 9.0.1)

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * changed the constraints of dependency `FBSDKCoreKit` inside your development pod `react-native-fbsdk-next`.

You should run `pod update FBSDKCoreKit` to apply changes you've made.

此外,使用该库需要修改appDelegate.m文件 在这里,但当我添加了代码后,它显示缺少一个引用。我知道缺少的引用是 FBSDKCoreKit 或者至少我认为是因为先前的 SDK 使用了这个库。为了解决这个问题,您需要添加pod,但是当我添加时,上面的错误就会出现。我不知道是否需要其他库,因为存在这种依赖关系,请帮忙!


你尝试过运行 pod repo update 吗? - Francois Nadeau
8个回答

5

对于"react-native-fbsdk-next": "^11.1.0",我做了以下操作:

  1. 在Podfile中更改了platform :ios, '12.0'(之前是'11.0')
  2. 删除了Podfile.lock
  3. pod install

4

我在我的 Mac M1 上遇到了同样的问题,并通过运行此命令解决了它。

1- cd ios
2- arch -x86_64 pod install --repo-update

非常感谢!只有您的决定起作用了。 - jocoders
成功了!arch -x86_64 是必要的。 - Sergio Carneiro

4
我已经修复了。
cd ios
rm -rf Podfile.lock
rm -rf Pods
pod repo update
pod install

1

检查您的react-native-fbsdk平台:ios版本。

  1. node_modules/react-native-fbsdk => platform:ios,"12.0" -> 例如:12.0

  2. 在ios/PodFile中设置您的platform:ios -> 例如:platform:io,"12.0"

  3. pod update


0
今天我遇到了同样的问题,通过在Podfile.lock中搜索´FBSDKCoreKit´解决了它。
然后我将8.2.0替换为9.0.1并运行pod install。这是我文件中的内容。
  - FBSDKCoreKit (9.0.1):
    - FBSDKCoreKit/Basics (= 9.0.1)
    - FBSDKCoreKit/Core (= 9.0.1)
 - FBSDKCoreKit/Basics (9.0.1)
 - FBSDKCoreKit/Core (9.0.1):
    - FBSDKCoreKit/Basics
 - FBSDKLoginKit (9.0.1):
    - FBSDKLoginKit/Login (= 9.0.1)
 - FBSDKLoginKit/Login (9.0.1):
    - FBSDKCoreKit (~> 9.0.1)
 - FBSDKShareKit (9.0.1):
    - FBSDKShareKit/Share (= 9.0.1)
 - FBSDKShareKit/Share (9.0.1):
    - FBSDKCoreKit (~> 9.0.1)

0
如果您正在使用 EAS,请尝试在 eas.json 文件中禁用缓存并重新构建:
``` { release: { cache: { disabled: true } } } ```

0
我所做的是,在podfile中将platform:ios,'10.0' 更新为platform:ios,'14.0'

0

你应该检查 react-native-fbsdk-next 的版本是否为 4.0

如果是,

rm -rf node_modules
yarn or npm install
npx pod-install ios

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接