我已经使用 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 中的确切文件夹是空的。所以我想这就是显示错误的原因。问题是如何解决这个问题......
这是我的嵌入式二进制文件
和链接的框架和库
在项目中的样子:
最佳答案
https://stackoverflow.com/questions/44808305/