swift - swift 5 中没有这样的模块“FacebookCore”
问题描述
作为 iOS 开发学习过程的一部分,我正在做自己的测试应用程序(在 Xcode 11.0 上使用 swift 5)。我想在我的登录页面上添加使用 Facebook 登录,但在导入库时我不断收到没有这样的模块“FacebookCore” 。
我按照developer.facebook上的说明尝试使用 cocoaPods 实现 SDK,这是我的 Podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'TestApp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for TestApp
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
target 'TestAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'TestAppUITests' do
# Pods for testing
end
end
按照 Facebook 的指示执行 pod install 并在我的 info.plist 中添加数据后,我可以清楚地看到该框架已链接到Link Binary With Libraries部分
但是,我似乎无法导入 FacebookCore 或 FacebookLogin。
PS:我尝试了几种解决方案,例如:
1-运行 .xcworkspace 而不是 .xcodeproj
2-即使显示错误也构建项目(有人说它会消失)
但他们都没有工作。
我怀疑问题出在我的框架搜索路径中,但为什么它首先会出错?所以我可能错了,无论如何,这是我的搜索路径的屏幕截图:
解决方案
Use FBSDKCoreKit instead of FacebookCore
This are the correct pods
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
and your imports should be
import FBSDKCoreKit
import FBSDKLoginKit
in previous version there was FacebookCoore as wrapper for the FBSDKCoreKit classes. It looks like Facebook has removed this since v5.x.
推荐阅读
- c++ - 在 C++ 中创建节点的不同方式是否令人困惑?
- r - R中的多个Shapefile导出为.csv
- angular - Angular 9 CLI 向后兼容性
- java - 如何使用 Kotlin/Java 解决 AWS 中的 AccessDeniedException?
- php - 消息:sizeof():参数必须是数组或实现了 Countable 的对象
- php - 在控制器上的字符串上调用成员函数 fill()
- r - 如何使用 glmmTMB 从模型输出中计算特定固定效应的预测均值
- security - 密码登录失败时如何防止密码对话框
- python-3.x - 使用python从netcdf绘制风矢量
- wpf - 如何理解 CurrentCell 在 WPF DataGrid 中是否处于编辑模式?