9

我正在创建一个 Flutter 插件。但是,当我尝试向插件的 iOS 部分添加依赖项时,我没有找到任何合适的指南。podspec我在插件的文件中声明了依赖项。但是该依赖项仅在example/ios通过 Pod 中可用,但我想在我ios的插件文件夹中访问该依赖项。这是我的podspec

#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
  s.name             = 'comet_chat'
  s.version          = '0.0.1'
  s.summary          = 'A new Flutter plugin.'
  s.description      = <<-DESC
A new Flutter plugin.
                       DESC
  s.homepage         = 'http://example.com'
  s.license          = { :file => '../LICENSE' }
  s.author           = { 'Your Company' => 'email@example.com' }
  s.source           = { :path => '.' }
  s.source_files = 'Classes/**/*'
  s.public_header_files = 'Classes/**/*.h'
  s.dependency 'Flutter'
  s.dependency 'CometChatPro', '1.4.0'

  s.ios.deployment_target = '10.0'
  s.preserve_paths = 'CometChatPro.framework'
  s.xcconfig = { 'OTHER_LDFLAGS' => '-framework CometChatPro' }
  s.vendored_frameworks = 'CometChatPro.framework'
end

我关注了这个问题,但没有任何帮助。如何解决这个问题?如何仅获取插件的依赖项?

4

0 回答 0