我安装了软件包using npm,然后按照these instructions (french)对其进行配置以用于iOS。但是我无法使用npx react-native run-ios
运行该应用,它给了我这个错误:
xcodebuild: error: Could not resolve package dependencies:
because no versions of facebook-ios-sdk match the
requirement 7.0.2..<8.0.0 and root depends on
facebook-ios-sdk 7.0.2..<8.0.0, version solving failed.
我尝试重新安装react-native-fbsdk
并再次安装Pod:
$ cd ios
$ rm Podfile.lock
$ pod repo update
$ pod install
Adding a custom script phase for Pod RNFBApp: [RNFB] Core Configuration
Auto-linking React Native modules for target `XXX`: RNCMaskedView, RNFBApp, RNFBAuth, RNGestureHandler, RNGoogleSignin, RNReanimated, RNScreens, RNVectorIcons, react-native-fbsdk, react-native-get-random-values, react-native-safe-area-context, and react-native-webview
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Downloading dependencies
Installing FBSDKCoreKit 7.1.1 (was 7.0.1 and source changed to `https://cdn.cocoapods.org/` from `trunk`)
Installing FBSDKLoginKit 7.1.1 (was 7.0.1 and source changed to `https://cdn.cocoapods.org/` from `trunk`)
Installing FBSDKShareKit 7.1.1 (was 7.0.1 and source changed to `https://cdn.cocoapods.org/` from `trunk`)
Generating Pods project
Integrating client project
Pod installation complete! There are 41 dependencies from the Podfile and 59 total pods installed.
另一方面,从xcode运行它没有问题(即使错误仍然出现)。
我的npm环境如下:
{
"react-native": "0.62.2",
"react-native-fbsdk": "^2.0.0",
}
答案 0 :(得分:0)
我仍然不知道文档中建议的安装发生了什么。但是我们通过更新 facebook-ios-sdk 解决了 Xcode 中的问题:
file
> Swift packages
> Update to latest package versions
。
运行后,facebook-ios-sdk 版本出现在 Xcode 中(对我们来说是 7.1.1)。然后错误消失了。