Bra*_*sen 13 xcode ios cocoapods swift flutter
我已经用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
Run Code Online (Sandbox Code Playgroud)
- -编辑 - -
我收到以下错误atm FBSDKCoreKit.framework: No such file or directory:.当我在xCode中打开Frameworks文件夹时,所有文件名都是红色的:
但Finder中的确切文件夹是空的.所以我猜这就是错误显示的原因.问题是如何解决这个问题......
这就是我embedded binaries和linked frameworks and libraries看起来像项目:

Bry*_*den 22
我会天真地假设你没有use_frameworks!你Podfile。如果这是真的,那么您有两种方法可以从这里开始:
在您Runner-Bridging-Header.h添加#import <FBSDKCoreKit/FBSDKCoreKit.h>,删除import FBSDKCoreKit从AppDelegate.swift,只是继续写代码。
添加use_frameworks!到您的Podfile并运行pod install再次。这可能会带来一些其他问题,但如果可行,我会建议这样做。
| 归档时间: |
|
| 查看次数: |
12701 次 |
| 最近记录: |