英文:
flutter fatal error: module 'FBSDKCoreKit' not found
问题
我正在使用 flutter_facebook_login 3.0.0
当我尝试运行我的应用程序时,我遇到了这个错误
> ** 构建失败 ** Xcode的输出: ↳ 从文件包含在/Users///ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/Internal/_FBSDKLoginRecoveryAttempter.m:21:
> 从文件包含在/Users///ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/Internal/FBSDKLoginKit+Internal.h:19:
> 从文件包含在/Users///ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/Internal/../FBSDKLoginKit.h:27:
> /Users///ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginButton.h:24:9:
> 严重错误: 模块 'FBSDKCoreKit' 未找到 @import FBSDKCoreKit;
> ~~~~ 1个错误生成。无法为模拟器构建应用程序。在iPhone 8上启动应用程序时出错。^
英文:
I'm using flutter_facebook_login 3.0.0
I got this error when i tried to run my app
> ** BUILD FAILED ** Xcode's output: ↳ In file included from /Users///ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/Internal/_FBSDKLoginRecoveryAttempter.m:21:
> In file included from
> /Users///ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/Internal/FBSDKLoginKit+Internal.h:19:
> In file included from
> /Users///ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/Internal/../FBSDKLoginKit.h:27:
> /Users///ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginButton.h:24:9:
> fatal error: module 'FBSDKCoreKit' not found @import FBSDKCoreKit;
> ~~~~ 1 error generated. Could not build the application^
> for the simulator. Error launching application on iPhone 8.
答案1
得分: 4
我已成功通过更改 Podfile 来解决此问题:
target 'Runner' do
# flutter Pod
use_frameworks!
use_modular_headers!
------
flutter clean
删除 Podfile.lock
运行以下命令:
pod install --repo-update
pod update FBSDKLoginKit
然后运行:
flutter clean && cd ios && sudo rm Podfile.lock && pod install --repo-update && pod update FBSDKLoginKit
打开 .xcworkspace,并在 General-> Deployment Info 中将目标设置为 11.0,同时在 Podfile 中也将目标设置为 11.0。
英文:
I have managed to solve this issue by changing the Podfile
target 'Runner' do
# flutter Pod
use_frameworks!
use_modular_headers!
------
flutter clean
Delete Podfile.lock
pod install --repo-update
pod update FBSDKLoginKit
Run
flutter clean && cd ios && sudo rm Podfile.lock && pod install --repo-update && pod update FBSDKLoginKit
open .xcworkspace and in General-> Deployment Info set Target 11.0 also in Podfile set Target 11.0
答案2
得分: 2
直到现在,对我有效的唯一方法是这个。
您将不得不用5.8.0版本的Facebook SDK覆盖Podfile.lock。
PODS:
- FBSDKCoreKit(5.8.0):
- FBSDKCoreKit/Basics(= 5.8.0)
- FBSDKCoreKit/Core(= 5.8.0)
- FBSDKCoreKit/Basics(5.8.0)
- FBSDKCoreKit/Core(5.8.0):
- FBSDKCoreKit/Basics
- FBSDKLoginKit(5.8.0):
- FBSDKLoginKit/Login(= 5.8.0)
- FBSDKLoginKit/Login(5.8.0):
- FBSDKCoreKit(〜> 5.0)
- Flutter(1.0.0)
英文:
Until now the only way that worked for me was this
You will have to override Podfile.lock with 5.8.0 version of Facebook SDK.
PODS:
- FBSDKCoreKit (5.8.0):
- FBSDKCoreKit/Basics (= 5.8.0)
- FBSDKCoreKit/Core (= 5.8.0)
- FBSDKCoreKit/Basics (5.8.0)
- FBSDKCoreKit/Core (5.8.0):
- FBSDKCoreKit/Basics
- FBSDKLoginKit (5.8.0):
- FBSDKLoginKit/Login (= 5.8.0)
- FBSDKLoginKit/Login (5.8.0):
- FBSDKCoreKit (~> 5.0)
- Flutter (1.0.0)
....
答案3
得分: 2
我已经在这个问题上反复尝试,并最终使它在iOS上的5.13.1
Podfiles上工作(工作的意思是编译、链接并安装到真实的iPhone上 - 我实际上不使用Facebook,但作为firebase-ui登录包的一部分,它是必需的 )
首先,执行pod clean
,例如:
运行:flutter clean
进入ios文件夹,删除Podfile、Podfile.lock、Pods文件夹、Runner.xcworkspace
再次运行项目
在构建后,我遇到了以下错误:
致命错误:找不到模块'FBSDKCoreKit'
@import FBSDKCoreKit;
然后,我在ios/podspec文件中添加了模块头文件覆盖,具体步骤在这里提到:https://github.com/roughike/flutter_facebook_login/issues/214#issuecomment-565166295
Podfile的开头如下所示:
platform :ios, '12.0'
use_modular_headers!
我注意到链接错误是由Frameworks部分中的一个虚假条目导致的,有关更多详细信息,请参考此讨论。
英文:
I've been around the houses and back with this and have eventually got this to work with the 5.13.1
Podfiles on iOS (by work, I mean compiling, linking and installing onto a real iPhone - I don't actually use Facebook but it's required as part of the firebase-ui login package )
Firstly, do a pod clean, e.g.
Run: flutter clean
Go to ios folder, delete Podfile, Podfile.lock, Pods folder, Runner.xcworkspace
Run project again
After building I got errors regarding:
fatal error: module 'FBSDKCoreKit' not found
@import FBSDKCoreKit;
I then added the modular headers override into the ios/podspec file mentioned here https://github.com/roughike/flutter_facebook_login/issues/214#issuecomment-565166295
The start of the podfile looks like this:
platform :ios, '12.0'
use_modular_headers!
I did note that linking errors, about missing Facebook libraries, were due to a spurious entry in the Frameworks section.
Futher details in this thread
答案4
得分: 2
我已按照以下步骤解决了这个问题,我遇到了这个问题是因为facebook_share插件:
- 降级facebook_share插件的版本到0.0.1+1。
- 在项目的终端中运行以下命令 - pod cache clean —all。
- 在Podfile中添加以下两个pods:
target 'Runner' do
use_frameworks!
use_modular_headers!
pod 'FBSDKCoreKit', '~> 6.0.0'
pod 'FBSDKShareKit', '~> 6.0.0'
- 在项目的终端中运行以下命令 - Pod install。
- 在项目的终端中运行以下命令 - pod update FBSDKShareKit。
完成,错误已移除。
英文:
I had resolved it by following below steps, I had faced this issue due to facebook_share plugin so
1.downgrade the version of facebook_share plugin to. 0.0.1+1
2.run command in your project's terminal - pod cache clean —all
3.add below two pods in Podfile:
target 'Runner' do
use_frameworks!
use_modular_headers!
pod 'FBSDKCoreKit', '~> 6.0.0'
pod 'FBSDKShareKit', '~> 6.0.0'
4.run command in your project's terminal - Pod install
5.run command in your project's terminal - pod update FBSDKShareKit
done, error removed
答案5
得分: 1
这个问题解决了我的问题 ['FBSDKCoreKit / FBSDKCoreKit.h' 文件未找到 ]
pod 'FBSDKCoreKit', '4.38'
pod 'FBSDKLoginKit', '4.38'
pod 'FBSDKShareKit', '4.38'
英文:
This issue solved my problem 'FBSDKCoreKit / FBSDKCoreKit.h' file not found
pod 'FBSDKCoreKit', '4.38'
pod 'FBSDKLoginKit', '4.38'
pod 'FBSDKShareKit', '4.38'
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论