我正在尝试将Facebook SDK添加到我的一个Flutter项目中。在常规Podfile中,它看起来像这样:
# Pods for facebooklogintest
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod ‘FBSDKLoginKit’
“facebooklogintest”是我项目的名称。 Flutter项目中的Podfile看起来有点不同。在“#Pods for Runner”下添加pod文件是否正确?
# Pods for Runner
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod ‘FBSDKLoginKit’
当我尝试安装它时出现以下错误,如上所示:
[!] Invalid `Podfile` file: Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework.
我应该在哪里和哪里指出这个文件以摆脱这个错误?
答案 0 :(得分:3)
试试这个:
def fbPods
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod ‘FBSDKLoginKit’
end
target 'facebooklogintest' do
fbPods
end
target 'Runner' do
fbPods
end
运行此命令
pod install --no-repo-update
答案 1 :(得分:0)
在bash_profile中, 导出FLUTTER_FRAMEWORK_DIR = / flutter / bin / cache / artifacts / engine / ios
source~ / .bash_profile
在iOS文件夹中 pod install