我已经使用Cocoapods安装了FBSDK,但由于某些原因无法在我的AppDelegate.swift文件中导入它。 FBSDK工具包出现在我的Xcode项目中,所以我觉得它应该可以工作。
我并不是iOS开发人员,只是想为Flutter SDK编写一个简单的本地插件。有人有想法吗?
--以下是pod文件的内容--
![enter image description here](https://istack.dev59.com/ajlzZ.webp)
--以下是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
---编辑---
目前我遇到以下错误:FBSDKCoreKit.framework:没有此文件或目录
。当我在xCode中打开Frameworks文件夹时,所有文件名都是红色的:
但是Finder中的确切文件夹为空。所以我想这就是为什么会显示错误的原因。问题是如何解决这个问题...
这是我的项目中embedded binaries
和linked frameworks and libraries
的样子: