ios - 无法导入使用 Cocoapods 安装的依赖项

我已经使用 Cocoapods 安装了 FBSDK,但由于某种原因无法将其导入我的 AppDelegate.swift 文件中。 FBSDK 套件出现在我的 Xcode 项目中,所以我觉得它应该可以工作。

无论如何,我都不是 iOS 开发者,我只是想为 Flutter SDK 编写一个简单的原生插件。有人有想法吗?

--这是 pod 文件的样子--

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

if ENV['FLUTTER_FRAMEWORK_DIR'] == nil
  abort('Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework')
end

target 'Runner' do
  use_frameworks!

  # Pods for Runner
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'

  # Flutter Pods
  pod 'Flutter', :path => ENV['FLUTTER_FRAMEWORK_DIR']

  if File.exists? '../.flutter-plugins'
    flutter_root = File.expand_path('..')
    File.foreach('../.flutter-plugins') { |line|
      plugin = line.split(pattern='=')
      if plugin.length == 2
        name = plugin[0].strip()
        path = plugin[1].strip()
        resolved_path = File.expand_path("#{path}/ios", flutter_root)
        pod name, :path => resolved_path
      else
        puts "Invalid plugin specification: #{line}"
      end
    }
  end
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

---编辑---

我收到以下错误 atm:FBSDKCoreKit.framework: No such file or directory。当我在 xCode 中打开 Frameworks 文件夹时,所有文件名都是红色的: 但 Finder 中的确切文件夹是空的。所以我想这就是显示错误的原因。问题是如何解决这个问题......

这是我的嵌入式二进制文件链接的框架和库在项目中的样子:

最佳答案

  1. 选择您的项目目标
  2. 转到build设置。
  3. 搜索标题搜索路径。
  4. 将此值 $(SRCROOT)/Pods 递归添加,然后 Xcode 将为您解析路径。

https://stackoverflow.com/questions/44808305/

相关文章:

android - 如何在 Flutter 中添加 Webview?

flutter - 无效参数 : Illegal argument in isolate messa

flutter - 使容器小部件垂直填充父级

flutter - 导航后打开 flutter 对话框

Flutter - 自定义字体不显示

dart - 在 Flutter 中将焦点滑动到 TextField

android-studio - 如何找到 Flutter SDK 的路径

android - Flutter - 从现有的 android 项目导入

flutter - Flutter AppBar 上的渐变背景

ios - Flutter - SWIFT_VERSION 必须设置为支持的值