我已经安装了带有CocoaPods的FBSDK,但由于某些原因无法将其导入到AppDelegate.swft文件中.FBSDK工具包出现在我的Xcode项目中,所以我觉得它应该可以工作. enter image description here

我无论如何都不是iOS开发人员,我只是想为Ffltter SDK编写一个简单的原生插件.有谁有主意吗?

--Here is what the pod file looks like--

# 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

---EDIT---

我收到以下错误ATM:FBSDKCoreKit.framework: No such file or directory.当我在Xcode中打开Frameworks文件夹时,所有文件名都是红色的: enter image description hereBut that exact folder in Finder is empty.所以我猜这就是显示错误的原因.问题是如何解决这个问题.

这是我的embedded binarieslinked frameworks and libraries在项目中的样子: enter image description here

推荐答案

  1. Select 您的项目目标
  2. 转到"生成设置".
  3. 搜索标题搜索路径.
  4. 用recursive添加这个值$(SRCROOT)/Pods,然后Xcode将为您解析路径.

enter image description here

Flutter相关问答推荐

在Flutter 中将参数从一个类传递到另一个类

video_player在Android上返回401 Unauthorized with Bunny CDN

在保持标高=1的情况下更改AppBar立面 colored颜色 /遮罩

Android Studio将不会构建iOS模拟器应用程序,因为plist.info有问题

来自FirebaseAuth的错误DisplayName和邮箱在Flutter应用程序中给出错误

Flutter 块消费者仅对特定的状态属性更改做出react

构建方法中的性能声明小部件

打开键盘时屏幕组件会被压扁

Flutter - Riverpod 2.0 - 如何访问 onDispose 回调?

Flutter 包错误:此应用程序使用的是已弃用的 Android 嵌入版本

Flutter: pie_chart 插件动画滚动问题

Elevated 和 Outlined 按钮之间的动画

是否有可能减少代码的编写,例如:ref.read(countProvider.notifier) - 在构建方法中?

Flutter/Dart - 从外部类更新状态

如何在向下滚动时隐藏顶部卡片并在向上滚动时出现?

Getx Flutter 在更新值时抛出空错误

有任何方法可以在应用程序移动背景恢复时显示 appopenAd

如何在椭圆形图像周围添加边框?Flutter

如何使按钮被选中?

在另一个页面编辑数据后更新 Flutter 页面的惯用方法?