颤动:使Podfiles工作

问题描述 投票:3回答:2

我正在尝试将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.

我应该在哪里和哪里指向此文件以摆脱此错误?

ios cocoapods flutter
2个回答
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

0
投票

在bash_profile中,导出FLUTTER_FRAMEWORK_DIR = / flutter / bin / cache / artifacts / engine / ios

source~ / .bash_profile

在iOS文件夹中,pod安装

© www.soinside.com 2019 - 2024. All rights reserved.